1
votes

I created a new laravel 5.4 Project + auth.

These are the steps I did.

  1. laravel new app
  2. laravel make:auth
  3. php artisan migrate

Now if I try to Register I get following error:

notfoundhttpexception in routecollection.php line 161

The Redirect in my RegisterController Looks like this:

protected $redirectTo = '/home';

and the home.blade.php file exists under ressources/views.

If I try to Change the URL to my main page I get this error:

View [login] not found

The user is still created. if I delete the user the error view[Login] dissappears.

My routes:

Auth::routes();

Route::get('/', 'HomeController@index'); // @index Returns to 'login'

But I still get the error any ideas?

2

2 Answers

1
votes

Make sure you have a route for /home:

Route::get('/home', 'HomeController@index');
0
votes

Concerning NotFoundHttpException in RouteCollection.php line 161
@Alexey Mezenin answered, you must either fix route in routes, or change protected $redirectTo = '/home'; to protected $redirectTo = '/'; in your RegisterController and LoginController

Concerning View [login] not found
RegisterController is doing its job, validating data and saving user to db, but it looks like you are returning login view in your HomeController, and probably the path is wrong, as it should be auth/login. Or you can instead of return view('auth/login') try return redirect('login'), if that is what youre aiming for.