How to create laravel auth login system

How to create laravel auth login system

In this article, I'm going to show How to create laravel auth login system. It's so easy to create login using laravel auth login. "php artisan make:auth" command can perform this task. In this article, I am going to create login system using laravel auth login.

I will create laravel auth login system with following steps.

1. Create a laravel project.
2. Create a database named "login".
3. Open ".env" file located root of your project folder.
4. Go to line no 9 and setup your database name, username and password.

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=login
DB_USERNAME=root
DB_PASSWORD=

5. Run "php artisan make:auth" command in terminal.

(In laravel 6.0, "php artisan make:auth" command is not defined. For fresh laravel 6.0 project, Install the laravel/ui Composer package and run php artisan ui vue --auth in a fresh Laravel application.
Example: run first, "composer require laravel/ui "^1.0" --dev" then run "php artisan ui vue --auth" the you will show "authentication scaffolding generated successfully").

Then you will see authentication scaffolding generated successfully.

6. Open "database" folder located root of project folder.

7. Open "migrations" folder located on "database" folder.

your table Schema is here line number 14.

 public function up()
    {
        Schema::create('users', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('name');
            $table->string('email')->unique();
            $table->timestamp('email_verified_at')->nullable();
            $table->string('password');
            $table->rememberToken();
            $table->timestamps();
        });
    }

8. Run "php artisan migrate" command.

"users" table will be created in "login" database.

9. Your job is done. Now, go your browser and click register then fill up all fields and complete your registration.

10. After completing registration, Just login your system. If everything fine then you will be reached in dashboard "home.blade.php". That's all, your login system is created successfully using laravel auth login.

11. login/registration page is located in "resources/views/auth/" folder. You can customize as your wise.

resources/views/auth/(register.blade.php or login.blade.php)

By following the above all steps you can easily create laravel login system using laravel auth login.


EmoticonEmoticon