Authentication does not work after running make:auth

Asked

Viewed 353 times

0

I execute the command:

SmartFlex> php artisan migrate  

within my project and it is finished correctly. The options of login and registration are available at view, but while trying to access the record, for example, the error occurs below:

Notfoundhttpexception in Routecollection.php line 179: in Routecollection.php line 179 At Routecollection->match(Object(Request)) in Router.php line 533 At Router->findRoute(Object(Request)) in Router.php line 512 At Router->dispatchToRoute(Object(Request)) in Router.php line 498 At Router->Dispatch(Object(Request)) in Kernel.php line 174 At Kernel->Illuminate Foundation Http{closure}(Object(Request)) in Pipeline.php line 30 At Pipeline->Illuminate Routing{closure}(Object(Request)) in Transformsrequest.php line 30 At Transformsrequest->Handle(Object(Request), Object(Closure)) in Pipeline.php line 148 At Pipeline->Illuminate Pipeline{closure}(Object(Request)) in Pipeline.php line 53 At Pipeline->Illuminate Routing{closure}(Object(Request)) in Transformsrequest.php line 30 At Transformsrequest->Handle(Object(Request), Object(Closure)) in Pipeline.php line 148 At Pipeline->Illuminate Pipeline{closure}(Object(Request)) in Pipeline.php line 53 At Pipeline->Illuminate Routing{closure}(Object(Request)) in Validatepostsize.php line 27 At validatepostsize->Handle(Object(Request), Object(Closure)) in Pipeline.php line 148 At Pipeline->Illuminate Pipeline{closure}(Object(Request)) in Pipeline.php line 53 At Pipeline->Illuminate Routing{closure}(Object(Request)) in Checkformaintenancemode.php line 46 At Checkformaintenancemode->Handle(Object(Request), Object(Closure)) in Pipeline.php line 148 At Pipeline->Illuminate Pipeline{closure}(Object(Request)) in Pipeline.php line 53 At Pipeline->Illuminate Routing{closure}(Object(Request)) in Pipeline.php line 102 At Pipeline->then(Object(Closure)) in Kernel.php line 149 At kernel->sendRequestThroughRouter(Object(Request)) in Kernel.php line 116 At kernel->Handle(Object(Request)) in index.php line 54

I’ve looked at several post about route problems but nothing else worked.

1 answer

2


This error may happen if the authentication routes are not properly logged in your route file.

To confirm this, run the command below and see if the authentication routes are registered:

php artisan route:list

Console

In the Laravel documentation we can find:

Want to get Started fast? Just run php Artisan make:auth and php Artisan migrate in a Fresh Laravel application. Then, navigate your browser to http://your-app.dev/register or any other URL that is Assigned to your application. These two Commands will take care of scaffolding your entire Authentication system!

Before executing php artisan migrate we need to execute php artisan make:auth.

Underneath the scenes, we have the following steps that are done by these commands:

  • Creation of authentication routes

    This step includes the following routes in the routes/web.php

    Auth::routes();
    
    Route::get('/home', 'HomeController@index')->name('home');
    

    These routes point to the controllers that are created together with the Laravel installation on app\Http\Controllers\Auth

  • Creation of authentication views

    Here are created the scaffolds of the views for login and records, in resources/views/auth

  • Tables in the database

    The command php artisan migrate will run the database Migrations that are on database/migrations. Laravel includes two tables that are created for authentication, the table user and the password_resets.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.