How to create authentication(login and registration) in Laravel 5.2?
In this post we will give you information about How to create authentication(login and registration) in Laravel 5.2?. Hear we will give you detail about How to create authentication(login and registration) in Laravel 5.2?And how to use it also give you demo for it if it is necessary.
We always wanted to do authentication system in your project, i mean sign-in, sign-out, sign-up and forgot password for our project. If you work on core PHP, or any PHP framework then it will take long time and large amount code as well to make auth module for your application.
But Laravel 5.2 provide simple way to create authentication module in your laravel application. Laravel 5.2 provide several php artisan command, that command through we can generate authentication module easily.
Laravel 5.2 also will create new auth route and blade file, that way you can also customize your auth module.
First, you haven’t installed fresh laravel 5.2 then you can get from bellow command:
composer create-project --prefer-dist laravel/laravel blog
Now you can run bellow command for create automatically authentication system:
php artisan make:auth
Output:
After this command will had updated your route file as bellow route:
Route::get('/', function () {
return view('welcome');
});
Route::group(['middleware' => 'web'], function () {
Route::auth();
Route::get('/home', 'HomeController@index');
});
You can also find HomeController in your Controller Directory.
php artisan command through you will also find several blade file using bootstrap layout like as bellow:
/resources/views/auth/login.blade.php
/resources/views/auth/register.blade.php
/resources/views/auth/passwords/email.blade.php
/resources/views/auth/passwords/reset.blade.php
/resources/views/auth/emails/password.blade.php
/resources/views/layouts/app.blade.php
/resources/views/home.blade.php
/resources/views/welcome.blade.php
So, let’s try to do this way and check in your project, just run ‘/’ URL…..
Hope this code and post will helped you for implement How to create authentication(login and registration) in Laravel 5.2?. if you need any help or any feedback give it in comment section or you have good idea about this post you can give it comment section. Your comment will help us for help you more and improve us. we will give you this type of more interesting post in featured also so, For more interesting post and code Keep reading our blogs