Apps (Coming Soon) 11 / 32
Genesis
Learn how to install DevDojo Auth with the Genesis starter kit.
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 Genesis app
Start by creating a new Laravel application:
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.
After creating a new Laravel application you can install Genesis with the following commands:
composer require devdojo/genesis dev-main
php artisan ui genesis
Next, be sure to compile your assets:
npm install && npm run dev
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
6. Enable the Name Field for Registration
As Genesis depends on the name field for registration, you'll want to enable this option in the setup page.
You can do that by visiting the /auth/setup route, clicking on Settings, and enabling the Registration Include Name Field option.
🎉 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.