DEV Community

Discussion on: Understanding Laravel Authentication: Best Practices and Tips

Collapse
 
bobbyiliev profile image
Bobby

Great post! 👏

I could also suggest this free auth package here that allows you to customize your auth pages easily:

GitHub logo thedevdojo / auth

This is the repo for the DevDojo Auth package

Auth Logo


Build Status Total Downloads Latest Stable Version License

About

Auth is a plug'n play authentication package for any Laravel application.

Be sure to visit the official documentation at devdojo.com/auth/docs

Installation

You can install this package into any new Laravel application, or any of the available Laravel Starter Kits.

composer require devdojo/auth

After the package has been installed you'll need to publish the authentication assets, configs, and more:

php artisan vendor:publish --tag=auth:assets
php artisan vendor:publish --tag=auth:config
php artisan vendor:publish --tag=auth:ci
php artisan vendor:publish --tag=auth:migrations

Next, run the migrations:

php artisan migrate
Enter fullscreen mode Exit fullscreen mode

Finally extend the Devdojo User Model:

use Devdojo\Auth\Models\User as AuthUser;

class User extends AuthUser

in your App\Models\User model.

Now, you're ready to rock! Auth has just been isntalled and you'll be able to visit the following authentication routes:

  • Login (project.test/auth/login)
  • Register (project.test/auth/register)
  • Forgot Password (project.test/auth/register)
  • Password Reset (project.test/auth/password/reset)
  • Password Reset Token (project.test/auth/password/ReAlLyLoNgPaSsWoRdReSeTtOkEn)
  • Password Confirmation (project.test/auth/password/confirm)
  • Two-Factor Challenge (project.test/auth/two-factor-challenge)

You'll also have access to the Two Factor…

Collapse
 
asfiaaiman profile image
Asfia Aiman

Thank you for sharing. I would love to try it!