Support the ongoing development of Laravel.io →
posted 9 years ago
Requests
Last updated 2 years ago.
0

Create a route for your dashboard which would include login view is user is not authenticated, or dashboard view if user is logged in.

Or handle that in your dashboard controller.

Last updated 2 years ago.
0

Or maybe you can use Ajax to load another page without reload

Last updated 2 years ago.
0

You will want to invoke the controller action of /public/login in the action body of /public/dashboard so that /public/dashboard actually returns the /public/login view.

i.e. (Where showLogin is the name of your controller method)

return $this->showLogin();
Last updated 2 years ago.
0

Or use iframe, but misleading the user that way is not good in the first place. The address bar should always represent what is shown.

Last updated 2 years ago.
0

james2037 said:

You will want to invoke the controller action of /public/login in the action body of /public/dashboard so that /public/dashboard actually returns the /public/login view.

i.e. (Where showLogin is the name of your controller method)

return $this->showLogin();

Yeah, thats what i want, just it's located in another controller, is it possible to use something like this?

AuthController@login
Last updated 2 years ago.
0

The solution for this:

$request = Request::create($uri, 'GET', array());
return Route::dispatch($request)->getContent();
0

Sign in to participate in this thread!

Eventy

Your banner here too?

shahroq shahroq Joined 14 Jun 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.