Skip to content

Commit

Permalink
updating the readme
Browse files Browse the repository at this point in the history
  • Loading branch information
tnylea committed Jun 6, 2024
1 parent 57262ca commit 5549fc9
Showing 1 changed file with 22 additions and 24 deletions.
46 changes: 22 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Auth is a plug'n play authentication package for any <a href="https://laravel.co

<a href="https://devdojo.com/auth" target="_blank"><img src="https://cdn.devdojo.com/images/june2024/devdojo-auth-image.png" class="w-full h-full" style="border-radius:10px" /></a>

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 <a href="https://devdojo.com/auth/docs" target="_blank">https://devdojo.com/auth/docs</a>

## Installation

Expand All @@ -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:

Expand All @@ -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

Expand All @@ -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).

0 comments on commit 5549fc9

Please sign in to comment.