PHPackages                             webard/sanctum-tokens - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. webard/sanctum-tokens

ActiveLibrary

webard/sanctum-tokens
=====================

A Laravel Nova resource tool for sanctum tokens.

v3.0.3(2y ago)0107MITVuePHP ^7.3|^8.0

Since Feb 29Pushed 2y agoCompare

[ Source](https://github.com/webard/sanctum-tokens)[ Packagist](https://packagist.org/packages/webard/sanctum-tokens)[ RSS](/packages/webard-sanctum-tokens/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (5)Used By (0)

Create a Sanctum Personal Access Tokens in Nova
===============================================

[](#create-a-sanctum-personal-access-tokens-in-nova)

This package allows you to use [Sanctum](https://laravel.com/docs/7.x/sanctum) to generate a Personal Access Tokens in [Nova](https://nova.laravel.com/).

This package is a fork of  with:

- resized token modal to 4xl to fit token length
- fixed copying
- confirmation icon after copy
- couple style improvements
- integrated expiration date column from PR [JeffBeltran#84](https://github.com/JeffBeltran/sanctum-tokens/pull/84)
- visual fixes in dark mode

Screenshot
----------

[](#screenshot)

[![View without any tokens](https://user-images.githubusercontent.com/22965241/175853019-a161fd10-5fde-4895-a094-26a7555f45dc.png)](https://user-images.githubusercontent.com/22965241/175853019-a161fd10-5fde-4895-a094-26a7555f45dc.png)[![Create Token View](https://user-images.githubusercontent.com/22965241/175853009-68f7d0bc-087a-49af-bbec-2d237e0330b7.png)](https://user-images.githubusercontent.com/22965241/175853009-68f7d0bc-087a-49af-bbec-2d237e0330b7.png)[![Post Create Token View](https://user-images.githubusercontent.com/22965241/175853005-466ccddb-4c25-42a0-9af0-42a4a088d249.png)](https://user-images.githubusercontent.com/22965241/175853005-466ccddb-4c25-42a0-9af0-42a4a088d249.png)[![View with single token](https://user-images.githubusercontent.com/22965241/175852995-5431d46f-daec-4831-9596-8d551a050286.png)](https://user-images.githubusercontent.com/22965241/175852995-5431d46f-daec-4831-9596-8d551a050286.png)[![Revoke Token Prompt](https://user-images.githubusercontent.com/22965241/175853279-fdd28f9c-d6ae-4abb-b769-12fc70cf2b23.png)](https://user-images.githubusercontent.com/22965241/175853279-fdd28f9c-d6ae-4abb-b769-12fc70cf2b23.png)

Prerequisites
-------------

[](#prerequisites)

1. [Install and Configure Sanctum](https://laravel.com/docs/7.x/sanctum#installation)
2. [Have Laravel Nova](https://nova.laravel.com/)
    - For Nova 4, use v2
    - Nova 3, use v1

Installation
------------

[](#installation)

```
composer require webard/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(),
    ];
}
```

Features
--------

[](#features)

### Hide Abilities

[](#hide-abilities)

You can hide the reference to the token abilities from the UI by calling the `hideAbilities()` method on the field.

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

### Set Default Abilities

[](#set-default-abilities)

If you don't want to use the default `*` token ability you can set your own by simply passing an array of strings to the `defaultAbilities()` method on the field.

This works well with the the `hideAbilities()` method if you want to hide the abilities logic from your users.

```
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()->defaultAbilities(['foo', 'bar-baz']),
    ];
}
```

### Localization

[](#localization)

Publish the package language files to your application's `resources/lang/vendor` directory:

```
php artisan vendor:publish --provider="Jeffbeltran\SanctumTokens\ToolServiceProvider"

```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

4

Last Release

803d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e34f6439ff69a5e372136c97bf9166d48010bfa7dd29af729e8a6db98d58335d?d=identicon)[webard](/maintainers/webard)

---

Top Contributors

[![JeffBeltran](https://avatars.githubusercontent.com/u/22965241?v=4)](https://github.com/JeffBeltran "JeffBeltran (49 commits)")[![semantic-release-bot](https://avatars.githubusercontent.com/u/32174276?v=4)](https://github.com/semantic-release-bot "semantic-release-bot (27 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (10 commits)")[![webard](https://avatars.githubusercontent.com/u/855788?v=4)](https://github.com/webard "webard (6 commits)")[![craftyshaun](https://avatars.githubusercontent.com/u/774763?v=4)](https://github.com/craftyshaun "craftyshaun (2 commits)")[![theofanisv](https://avatars.githubusercontent.com/u/6011795?v=4)](https://github.com/theofanisv "theofanisv (1 commits)")[![tpetry](https://avatars.githubusercontent.com/u/315686?v=4)](https://github.com/tpetry "tpetry (1 commits)")[![mn-martin](https://avatars.githubusercontent.com/u/12658648?v=4)](https://github.com/mn-martin "mn-martin (1 commits)")[![anibalsanchez](https://avatars.githubusercontent.com/u/385780?v=4)](https://github.com/anibalsanchez "anibalsanchez (1 commits)")[![chrisbjr](https://avatars.githubusercontent.com/u/571279?v=4)](https://github.com/chrisbjr "chrisbjr (1 commits)")[![alancolant](https://avatars.githubusercontent.com/u/19172637?v=4)](https://github.com/alancolant "alancolant (1 commits)")[![ryanmitchell](https://avatars.githubusercontent.com/u/51899?v=4)](https://github.com/ryanmitchell "ryanmitchell (1 commits)")

---

Tags

laravelsanctumnova

### Embed Badge

![Health badge](/badges/webard-sanctum-tokens/health.svg)

```
[![Health](https://phpackages.com/badges/webard-sanctum-tokens/health.svg)](https://phpackages.com/packages/webard-sanctum-tokens)
```

###  Alternatives

[optimistdigital/nova-sortable

This Laravel Nova package allows you to reorder models in a Nova resource's index view using drag &amp; drop.

2872.1M6](/packages/optimistdigital-nova-sortable)[outl1ne/nova-sortable

This Laravel Nova package allows you to reorder models in a Nova resource's index view using drag &amp; drop.

2861.8M9](/packages/outl1ne-nova-sortable)[jeffbeltran/sanctum-tokens

A Laravel Nova resource tool for sanctum tokens.

54557.4k](/packages/jeffbeltran-sanctum-tokens)[laravel/nova-log-viewer

A Laravel Nova tool for viewing your application logs.

136301.3k1](/packages/laravel-nova-log-viewer)[stepanenko3/nova-command-runner

Laravel Nova tool for running Artisan and bash(shell) commands.

36983.0k](/packages/stepanenko3-nova-command-runner)[sbine/route-viewer

A Laravel Nova tool to view your registered routes.

57215.9k](/packages/sbine-route-viewer)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
