Skip to content

thedevdojo/auth

Repository files navigation

Auth Logo


Build Status Total Downloads Latest Stable Version License

About Auth

The DevDojo Auth package is a plug'n play Authentication wrapper for your Laravel application. Easily update and modify your authentication pages, add social providers, and many other auth features.

Laravel is accessible, powerful, and provides tools required for large, robust applications.

Installation

To install this package you'll want to first have Laravel Breeze, Jetstream, Genesis, or any other Laravel starter kit installed. Then you'll need to install the package:

composer require devdojo/auth

After the package has been installed you'll need to publish the authentication assets with the followign command:

php artisan vendor:publish --tag=auth:assets

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)

Auth Migrations

You'll also want to include the auth migrations:

php artisan migrate --path=vendor/devdojo/auth/database/migrations 

This will add a new social_provider_user table and it will also allow the name and password fields in the default user table to be nullable.

Auth Config

You will also need to publish the auth config by running the following:

php artisan vendor:publish --tag=auth:config

Adding the HasSocialProviders Trait.

You can add all the social auth helpers to your user model by including the following Trait:

<?php

namespace App\Models;

use Illuminate\Foundation\Auth\User as Authenticatable;
use Devdojo\Auth\Traits\HasSocialProviders; // Import the trait

class User extends Authenticatable
{
    use HasSocialProviders; // Use the trait in the User model

    // Existing User model code...
}

License

The Laravel framework is open-sourced software licensed under the MIT license.