In my previous post "How to deploy Laravel on Heroku? - Beginner's Guide !", we created a Laravel project and deployed it on to Heroku cloud platform. Before this please refer it to learn how to create a Laravel project.
Implementing an authentication mechanism is pretty easy in Laravel framework. Almost all things i.e. Login, Register, Session management, Routes are provided my Laravel itself out of the box. Just need to hi one following command:
$ php artisan make:auth
You have created an authentication scaffolding successfully. Now one more step is to migrate the tables generated by the Laravel for storing the users and other things which are necessary for managing authentication. This command will create tables in the database.
$ php artisan migrate
Hey Buddy! You did it!
Now, access these pages /Login, /Register.
What this$ php artisan make:authcommanddoes behind the scene?
This installs a login, register, forgot password page views. Also, it installs all routes for all authentication endpoints. All the view files are created in resources/views/authfolder. The base layout is created in resources/views/layouts. Also, this will install some controllers RegisterController, LoginController, ForgotPasswordController, ResetPasswordController. These controllers are used to handle your requests and request data.These controllers are located in App\Http\Controllers\Auth.
A HomeController will also be generated to handle post-login requests to your application's dashboard.
What Next?
You can support me here by subscribing to email updates for my new posts.
Share this post.
ManyThanks !!!!
How to create Login, Register and Authentication in Laravel? - Beginner's Guide from scratch.
Reviewed by Viral Titles
on
2:18 PM
Rating: 5
No comments