diff --git a/README.md b/README.md index 10c7319..7e84660 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ Auth is a plug'n play authentication package for any -Be sure to visit the official documentation at [https://devdojo.com/auth/docs](https://devdojo.com/auth/docs) +Be sure to visit the official documentation at https://devdojo.com/auth/docs ## Installation @@ -23,40 +23,39 @@ To install this package you'll want to first have Laravel Breeze, Jetstream, Gen composer require devdojo/auth ``` -After the package has been installed you'll need to publish the authentication assets with the following command: +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 ``` -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) +Next, run the migrations: -## Auth Migrations +```php +php artisan migrate +``` -You'll also want to include the auth migrations: +Finally extend the `DevDojo\User ``` -php artisan migrate --path=vendor/devdojo/auth/database/migrations +class User extends Devdojo\Auth\Models\User ``` -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. +in your `App\Models\User` model. -## Auth Config +Now, you're ready to rock! Auth has just been isntalled and you'll be able to visit the following authentication routes: -You will also need to publish the auth config by running the following: - -``` -php artisan vendor:publish --tag=auth:config -``` + - 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) -## Adding the HasSocialProviders Trait. +## (Optional) Adding the HasSocialProviders Trait. You can add all the social auth helpers to your user model by including the following Trait: @@ -65,10 +64,9 @@ You can add all the social auth helpers to your user model by including the foll namespace App\Models; -use Illuminate\Foundation\Auth\User as Authenticatable; use Devdojo\Auth\Traits\HasSocialProviders; // Import the trait -class User extends Authenticatable +class User extends Devdojo\Auth\Models\User { use HasSocialProviders; // Use the trait in the User model @@ -78,4 +76,4 @@ class User extends Authenticatable ## License -The Laravel framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT). +The DevDojo Auth package is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).