Skip to content

64robots/nova-passport-access-tokens

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published