/sanctum-tokens

Simple Nova Plugin to generate a Laravel Sanctum Personal Access Token

Primary LanguageVue

Create a Sanctum Personal Access Tokens in Nova

This package allows you to use Sanctum to generate a Personal Access Tokens in Nova.

Screenshot

screenshot of providing a name screenshot of providing a name screenshot of providing a name

Prerequisites

  1. Install and Configure Sanctum
  2. Have Laravel Nova

Installation

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(),
    ];
}

Other Info

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.