How to Create a Simple Login Authentication System in LARAVEL?Part-1

How to Create a Simple Login Authentication System in LARAVEL?

Firstly, we’ll create a new project for this.

Step 1. Go to XAMPP/htdocs folder -> right Click->Open Git Bash Here

Step 2. To Create a New Project in Laravel, write down the following command:

Step 3. To Go the current working Project directory, write down this following command:

It’ll be redirected to the current Project.

Mysql Database connection Laravel

Step 4. To Create a new Database so we have to Go to XAMPP server->phpMyAdmin->Click New Database-> customerservice.

Step 5. Thereafter, Open Sublime Text and Go to .env file to set the current project path and give the project APP_URL path, DB_DATABASE name and DB_USERNAME name.

Step 6. To Migrate the user table which is in-built in database/migrations/ to Mysql database. Write down the following command:

Step 7.  To Insert user records in users table by use of Laravel seeders.  Write down the following command:

Step 8. Now, Go to the database/seeds/UsersTablesSeeder.php and define single user data in the run() method.

Step 9. After that, Go to the database/seeds/DatabaseSeeder.php and call the UsersTablesSeeder.php class within the run() method.

Step 10. Here, we’ll Insert data into the UsersTablesSeeders. Write down the following command:

Inserted date into users table

Step 11. To Create a Controller in the app/Http/Controllers folder. Write down the following command:

Step 12. After that, we need to load the login form, write this code within the index() method.

Step 13. So, Create login.blade.php file in resources/views to display

Step 14. Thereafter, Go to routes/web.php file and we’ll set route request.

Login Page

Thanks

Total Page Visits: 125 - Today Page Visits: 0