Thứ Bảy, 3 tháng 9, 2016

Laravel 5 Tutorial : Authentication Login & Registration Form + Bootstrap in laravel 5.3


Implementing Authentication Login form, Registration and Password reset in laravel 5.3 is very simple. That will be located on config\auth.php folder. How to create Authentication Login & Registration Form in Laravel 5.3? we can use simple Artisan command "php artisan make:auth" and then just crate new migrate, please read How to Database Migration & Schema in Laravel 5.3.

Authentication Defaults in laravel 5.3

'defaults' => [
        'guard' => 'web',
        'passwords' => 'users',
    ],

Authentication Guards

'guards' => [
        'web' => [
            'driver' => 'session',
            'provider' => 'users',
        ],

        'api' => [
            'driver' => 'token',
            'provider' => 'users',
        ],
    ],

User Providers

'providers' => [
        'users' => [
            'driver' => 'eloquent',
            'model' => AppUser::class,
        ],

        // 'users' => [
        //     'driver' => 'database',
        //     'table' => 'users',
        // ],
    ],

Resetting Passwords

'passwords' => [
        'users' => [
            'provider' => 'users',
            'table' => 'password_resets',
            'expire' => 60,
        ],
    ],

Create Login & Registration Form + Bootstrap in laravel 5.3

First, after following this tutorial, you must have an database before and connect with your Laravel project, read How to Connect Database in laravel 5.3

Authentication Login & Registration Form + Bootstrap in laravel 5.3

At your laravel project, we will create Register, Login and new routes into your laravel project just by following this artisan command :

php artisan make:auth

Than, please see on resources\views\auth folder, you will got login and register with blading templates.

Now, following this command to migrate new tables into our database.

php artisan migrate

To know more about migrate please read How to Database Migration & Schema in Laravel 5.3

In your database, you will get new tables where table name is "users". Just try to access your login and register form by following this command

http://localhost:8080/register ->> to register new user
http://localhost:8080/login - >> to login

How to add Bootsrtap Theme in Login and Registration Form?

please read How to Adding Bootstrap Theme to Laravel 5.3 or just watch video tutorial below.

Video Tutorial

How to make Authentication Login & Registration Form + Bootstrap in laravel 5.3


See you next Lessons...............

Không có nhận xét nào:

Đăng nhận xét