Long story short: the AuthController has a bit of logic where it redirects you back to /home
Since you dont have a /home route but a /dashboard it tells you that no route exists for it
Just add the following to AuthController
class AuthController extends Controller
{
protected $redirectPath = "/dashboard"; // <= this
...
If you really wanna know: the culprit trait is called RedirectsUsers
julianSelser said:
Long story short: the AuthController has a bit of logic where it redirects you back to /home
Since you dont have a /home route but a /dashboard it tells you that no route exists for it
Just add the following to AuthController
class AuthController extends Controller { protected $redirectPath = "/dashboard"; // <= this ...
If you really wanna know: the culprit trait is called RedirectsUsers
Julian thanks for your reply. I had this code snippet already in place (but with an apostrophe instead -changed it) . The thing is that now it keeps me on the same place (register) instead of where I want it to be (dashboard).
Here's my code: (snippet from AuthController.php)
class AuthController extends Controller
{
use AuthenticatesAndRegistersUsers, ThrottlesLogins;
protected $redirectTo = "/dashboard";
please help me ?
So this is what I've done in DashboardController.php (controller of the page that gets the autheticated user):
public function retrieve()
{
$user = Auth::user();
return $user->name;
}
I have added this function to get the user name.
Also I have changed the $redirectTo value to this:
protected $redirectTo = "dashboard";
And now I can view the user name in the dashboard view.
Just got to this, I'm glad you got it working. Thanks for sharing.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community