🚀 DevOps & SRE Certification Program 📅 Starting: 1st of Every Month 🤝 +91 8409492687 🔍 Contact@DevOpsSchool.com

Upgrade & Secure Your Future with DevOps, SRE, DevSecOps, MLOps!

We spend hours on Instagram and YouTube and waste money on coffee and fast food, but won’t spend 30 minutes a day learning skills to boost our careers.
Master in DevOps, SRE, DevSecOps & MLOps!

Learn from Guru Rajesh Kumar and double your salary in just one year.


Get Started Now!

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:

$ composer create-project --prefer-dist laravel/laravel CustomerService "5.8.*"

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

$ cd CustomerService

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:

$ php artisan migrate

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


$ php artisan make:seeder UsersTablesSeeder

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


       User::create([
            'name'    => 'Usha Kiran',
            'email'    => 'usha.cotocus@gmail.com',
            'password'   =>  Hash::make('password'),
            'remember_token' =>  str_random(10),
        ]);

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:

$ php artisan db:seeder

Inserted date into users table

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

$ php artisan make:controller MainController --resource

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

 public function index()
    {
        return view('login');
    }

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.

Route::get('/login', 'MainController@index');
Login Page

Thanks

Certification Courses

DevOpsSchool has introduced a series of professional certification courses designed to enhance your skills and expertise in cutting-edge technologies and methodologies. Whether you are aiming to excel in development, security, or operations, these certifications provide a comprehensive learning experience. Explore the following programs:

DevOps Certification, SRE Certification, and DevSecOps Certification by DevOpsSchool

Explore our DevOps Certification, SRE Certification, and DevSecOps Certification programs at DevOpsSchool. Gain the expertise needed to excel in your career with hands-on training and globally recognized certifications.