Skip to content

Commit

Permalink
Improved docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuel committed Mar 30, 2018
1 parent f54e8aa commit 8aa913a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Add multi-authentication support to [Laravel Passport](https://laravel.com/docs/

- Install using composer:

```console
```sh
$ composer require smartins/passport-multiauth
```

Expand All @@ -40,7 +40,7 @@ $ composer require smartins/passport-multiauth

- Migrate database to create `oauth_access_token_providers` table:

```console
```sh
$ php artisan migrate
```

Expand Down Expand Up @@ -187,7 +187,7 @@ class AuthServiceProvider extends ServiceProvider

Just run the `vendor:publish` artisan command with package provider as parameter:

```console
```sh
$ php artisan vendor:publish --provider="SMartins\PassportMultiauth\Providers\MultiauthServiceProvider"
```

Expand Down Expand Up @@ -241,6 +241,12 @@ Route::group(['middleware' => ['api', 'auth:admin,api']], function () {
});
```

You can use too the `Auth` facade:

```php
Auth::guard('api')->user();
```

### Refreshing tokens

- Add the `provider` parameter in your request at `/oauth/token`:
Expand Down Expand Up @@ -275,7 +281,7 @@ protected $routeMiddleware = [

The middlewares are equals the `Laravel\Passport` middlewares with guard `api` on `request->user()` object.

User Sample:
Use Sample:

```php
Route::group([
Expand Down
1 change: 1 addition & 0 deletions src/ProviderRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ class ProviderRepository
{
/**
* Find on `oauth_access_token_providers` table by `oauth_access_token_id`.
*
* @param string $tokenId
* @return \SMartins\PassportMultiauth\Provider|null
*/
Expand Down

0 comments on commit 8aa913a

Please sign in to comment.