Home
Get Started
Basics
Configuration
Extending Functionality
Resources

Installation

This package is compatible with any Laravel application (10.x or greater) and all available starter kits. Choose a guide above for a detailed installation walkthrough for your use case.

Below is the basic installation steps for most applications.

1. Install the Package

Install the package via composer

composer require devdojo/auth

2. Publish the Files

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

3. Run Migrations

Run the database migrations:

php artisan migrate

4. Extend the DevDojo User Model

Your default User model needs the methods that handle 2FA and Email Verification.

To do this we want extend the DevDojo User Model from your default App\Models\User.php, navigate to the App\Models\User.php file and add the following class to the top:

use Devdojo\Auth\Models\User as AuthUser;

and extend the AuthUser class:

class User extends AuthUser

Here is what your default User Model should look like:

<?php

namespace App\Models;

use Devdojo\Auth\Models\User as AuthUser;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;

class User extends AuthUser
{
    ...
}

5. Installation Complete

Now that everything is installed you'll be able to visit the auth setup route at website.test/auth/setup. You'll also have access to all the new Authentication Pages.

Installing in an Existing Application

As long as your application meets the minimum requirements (Laravel 10 or higher), you'll be able to install DevDojo Auth in your existing application. The steps will be the same as above. You'll also want to remove your existing Authentication from your application to remove duplicate functionality.

It's possible to keep your existing authentication functionality to ensure everything works correctly; however, having multiple authentication paths may confuse your users.