Laravel Auth::routes() Email verification Reset password Authentication Registration routes

php artisan make:auth, ui, ui:auth in Laravel 6

Refer to Part III of the current tutorial

Part I:

laravel new project --auth
laravel new my-test-app --auth
Laravel new my-test-appcd my-test-appcomposer require laravel/ui --devphp artisan ui vue --auth
php artisan make:auth
Command “make:auth” is not defined
Laravel new my-test-app#composer require laravel/ui --dev
php artisan ui --help
php artisan help ui
// Generate basic scaffolding...php artisan ui bootstrap
php artisan ui vue
php artisan ui react
// Generate login / registration scaffolding...php artisan ui bootstrap --auth
php artisan ui vue --auth
php artisan ui react --auth
php artisan migrate
npm install
npm run dev
After running: npm run dev
php artisan ui:auth
php artisan ui:auth --views

Part II:

php artisan make:auth
Auth::routes();Route::get('/home', 'HomeController@index');

If you want to make your Sublime Text pretty as like as mine read this tutorial!

class Auth extends Facade
{
/**
* Get the registered name of the component.
*
* @return string
*/
protected static function getFacadeAccessor()
{
return 'auth';
}
/**
* Register the typical authentication routes for an application.
*
* @param array $options
* @return void
*/
public static function routes(array $options = [])
{
static::$app->make('router')->auth($options);
}
}
public function auth(array $options = [])
{
// Authentication Routes...
$this->get('login', 'Auth\LoginController@showLoginForm')
->name('login');
$this->post('login', 'Auth\LoginController@login');
$this->post('logout', 'Auth\LoginController@logout')
->name('logout');
// Registration Routes...
if ($options['register'] ?? true) {
$this->get('register', 'Auth\RegisterController@showRegistrationForm')
->name('register');
$this->post('register', 'Auth\RegisterController@register');
}
// Password Reset Routes...
if ($options['reset'] ?? true) {
$this->resetPassword();
}
// Email Verification Routes...
if ($options['verify'] ?? false) {
$this->emailVerification();
}
}
$this->emailVerification();
public function resetPassword()
{
$this->get('password/reset', 'Auth\ForgotPasswordController@showLinkRequestForm')->name('password.request');
$this->post('password/email', 'Auth\ForgotPasswordController@sendResetLinkEmail')->name('password.email');
$this->get('password/reset/{token}', 'Auth\ResetPasswordController@showResetForm')->name('password.reset');
$this->post('password/reset', 'Auth\ResetPasswordController@reset')->name('password.update');
}

public function emailVerification()
{
$this->get('email/verify', 'Auth\VerificationController@show')->name('verification.notice');
$this->get('email/verify/{id}', 'Auth\VerificationController@verify')->name('verification.verify');
$this->get('email/resend', 'Auth\VerificationController@resend')->name('verification.resend');
}
php artisan route:listphp artisan route:list --compactphp artisan route:list -cphp artisan route:list | grep register     # for mac and linuxphp artisan route:list | findstr register. # for windows
php artisan route:list --name=
php artisan route:list --path=
php artisan route:list --method=
Auth::routes(['verify' => true]);
Auth::routes();
Route::group(['middleware' => ['web']], function() {});
Auth::routes(['verify' => true]);
Auth::routes();
Route::get('email/verify', 'Auth\VerificationController@show')
->name('verification.notice');
Route::get('email/verify/{id}', 'Auth\VerificationController@verify')->name('verification.verify');
Route::get('email/resend', 'Auth\VerificationController@resend')
->name('verification.resend');

Part III:

Laravel 6 Email Verification Routes

Auth::routes(['verify' => true]);
Auth::routes(['verify' => true]);
$request()->user()
$this->middleware('auth');
'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
$this->middleware('auth');
$this->middleware('verified');

--

--

Posting about Python and Laravel

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store