This is the second part of a series of related articles regarding different Laravel authentication methods. We will show how to create a custom email/password implementation of login and regsitration. Usually, the default setup as shown in part 1 is good enough for most use cases along with some flexibilities. So going for this custom route is for when you have a special scenario. We will however implement a simple login/register procedure as a demo to have a good comparison.
For the requirements, I recommend to fist setup using Docker which I did a write up here. This allows us to avoid environment based issues by having a simillar baseline. I've written this article using Laravel 7 but it should work on other versions above 5.
Setup the database and "users" table using Laravel migration. The default Laravel users migration is enough for this demo.
The focus is first in registration. Create the register page by creating file "regsiter.blade.php" in "app/resources/views/". Write the code below. Notice that we will keep it simple for this demo.app/resouces/views/register.blade.php
Create a single-action controller for displaying the register page using artisan command.
Enter the following code in ShowRegisterController.php.app/Http/Controllers/ShowRegisterController.php