This package allows you to use Sanctum to generate a Personal Access Tokens in Nova.
composer require jeffbeltran/sanctum-tokens
Register the plugin by adding SanctumTokens::make()
to the array of fields in the Nova resource. Make sure the
HasApiTokens
trait from the Sanctum package has been added to your model.
use Jeffbeltran\SanctumTokens\SanctumTokens;
/**
* Get the fields displayed by the resource.
*
* @param \Illuminate\Http\Request $request
* @return array
*/
public function fields(Request $request)
{
return [
ID::make('ID', 'id')->sortable(),
...
SanctumTokens::make(),
];
}
This is super basic plugin at the moment, I just needed a quick way to generate a Sanctum token from Nova. This does not allow or support other features that Sanctum does, however ,if there is a want/need from other people i'll get more functionality added.