Access all articles in sprocket icon.
Published October 23, 2016 by Bill Keck.
How To Create User Registration and Login in Laravel 5.3
This is going to be a very short tutorial for beginners, since making the user registration and login for Laravel 5.3 is incredibly easy.
We are assuming that you are starting with a fresh install of laravel, with a working database connection. See the Laravel docs for installation instructions. After installing, run the following from the command line:
php artisan migrate
That will create your users table and your password_resets table. Once we create the registration and login forms, we will be ready to go.
Ok, so next, run the following command:
php artisan make:auth
This command will create all the login and registration forms for you. It will also create a layouts folder and master page named app.blade.php. Each one of the auth views, like register.blade.php will extend that page.
You will find the links to the login and register forms on the top right of the page. Go ahead and register a user, you will see that it works. You also get a fully functional password recovery link, though you do need to set up mailtrap.io or set your email to go to your log files to test it.
Laravel also created a HomeController, which will land you on the /home uri if you are logged in.
The make:auth command does not create a RegisterController or LoginController because they were already there before you ran the command. Using Laravel’s out of the box solution will allow you create robust applications, so this is something you can build upon.
Anyway, you can see how easy all of this is. Laravel makes it such a simple task to get your user registration and login up and running.
Thanks to everyone who has and is supporting my work for beginners. I don’t have a donate button, but if you would like to contribute, you may do so by buying one of my books, Laravel 5.3 For Beginners. I would really appreciate it. Shares, comments, likes, and book reviews are also greatly appreciated. See you soon.