1

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 Answers 2

1

Make sure you have a route for /home:

Route::get('/home', 'HomeController@index'); 
Sign up to request clarification or add additional context in comments.

4 Comments

@Micheasl you still need to add a route for /home. Update Route::get('/', 'HomeController@index'); to what Alexey suggests.
ok I did that but I still get this error View [login] not found.
@Micheasl this is not related to your original question. You're getting the second error because you're using route('login') instead of url('login') somewhere in your app.
@AlexeyMezenin it is strange because I only did those steps above,
0

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.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.