install auth laravel 8 code example

Example 1: laravel setup auth

// Only for laravel 6.x and higher
composer require laravel/ui "^1.0" --dev

php artisan ui vue --auth

Example 2: how to change laravel 8 login credentials

//add below code to fortify service provider boot function
Fortify::authenticateUsing(function (LoginRequest $request) {
		    $user = User::where('user_name', $request->user_name);

		    if (
			    $user &&
			    Hash::check($request->password, $user->password)
		    ) {
			    return $user;
		    }
	    });
//and change username in fortify config 
'username' => 'user_name',

Example 3: laravel 8 make:auth

composer require laravel/ui --dev
php artisan ui vue --auth

Example 4: laravel 8 make:auth

composer require laravel/ui
php artisan ui vue --auth
php artisan migrate

Example 5: laravel 8 make:auth

php artisan migrate
npm install && npm run dev

Tags:

Php Example