Laravel Authentication 5.4

2

Talk to people, so recently I started to study Laravel through some books / video lessons, and I'm bending my head with something about authentication.

When I run the command php artisan make:auth Laravel returns me

The Routes

Auth::routes();

The Controllers

AndtheViews

Sofarsogood,butrunningthecommandphpartisanroute:listitindicatesforexamplethattherouteaccessedtologinislocatedinApp\Http\Controllers\Auth\LoginController@login,butasyoucanseeinthenextimagethereisnologinmethodinthisclassLoginController.

Can someone explaining how Laravel authentication works?

PS: I could not put all the images, I put the main ones then.

    
asked by anonymous 08.04.2017 / 17:49

1 answer

4

Okay, come on ... you see that PHP is using a trait AuthenticatesUsers, this trait is the page you are looking for where you have the login method and tb the logout.

In the LoginController, see this line:

use AuthenticatesUsers; 

That uses this namespace (path):

use Illuminate\Foundation\Auth\AuthenticatesUsers;

Now, let's go to the folder: vendor / laravel / src / Illuminate / Foundation / Auth / AuthenticatesUsers.php

See? The methods are all there, it's in the vendor folder (where you have the laravel framework itself with all your classes.) In the Auth folder you can see all the code and know more about the behavior of the authentication class. bit of authentication and watch some videos on the laracasts.

    
09.04.2017 / 00:35