Skip to content

Latest commit

 

History

History
80 lines (62 loc) · 1.62 KB

readme.md

File metadata and controls

80 lines (62 loc) · 1.62 KB

Nova Passport Access Token Manager

Manage Laravel Passport personal access tokens.

Requirements

Installation

  1. composer require "64robots/nova-passport-access-tokens:*"
  2. Add the tool to your app\Providers\NovaServiceProvider.php:

     public function tools()
     {
         return [
             // ...
             new R64\NovaPassportAccessTokens\NovaPassportAccessToken\NovaPassportAccessToken,
         ];
     }
  3. Implement R64\NovaPassportAccessTokens\NovaIssuableToken in your App\Models\Users

namespace App\Models\User;
use Illuminate\Database\Eloquent\Collection;


class User extends Authenticatable implements NovaIssuableToken
{

    public static function getForNova(): Collection 
    {
        //
    }

}
  1. Implement R64\NovaPassportAccessTokens\ScopeForNova in your App\Models\Token
namespace App\Models\Token;
use R64\NovaPassportAccessTokens\ScopeForNova;

class Token extends \Laravel\Passport\Token implements ScopeForNova
{
    public function scopeForNova($query)
    {
        //
    }
}
  1. Use App\Models\Token in AppServiceProvider
namespace App\Providers;

use App\Models\Token;
use Illuminate\Support\ServiceProvider;
use Laravel\Passport\Passport;

class AppServiceProvider extends ServiceProvider
{
    public function boot()
    {
        Passport::useTokenModel(Token::class);
    }
}

Usage

Nova Tools

Passport Management

Screen Shot 2019-08-22 at 4 55 38 PM