Apps (Coming Soon) 08 / 32
New Laravel App
Learn how to install DevDojo Auth within a new Laravel app.
In each of these installation steps we are assuming that you already have a local Laravel development environment running on your machine.
1. Create a new Laravel app
laravel new project
For simplicity's sake, go ahead and select
SQLiteas the database you would like to use. Otherwise, you'll need to create a new database and update the credentials in your.env.
Be sure to change into the root directory of the project you just created: cd project.
2. Install the Package
composer require devdojo/auth
3. Publish the Assets, Configs, CI Workflow, and Migrations
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
4. Run the new Database Migrations
php artisan migrate
5. Extend the DevDojo User Model
Your default User model needs the methods that handle 2FA and email verification. Add the following import to the top of App\Models\User.php:
use Devdojo\Auth\Models\User as AuthUser;
and extend the AuthUser class:
class User extends AuthUser
🎉 Installation Complete
You will now be able to visit all the Authentication Pages as well as the setup page, where you can modify the authentication functionality and appearance.