New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

devtical/filament-sanctum

Manage Laravel Sanctum personal access tokens from your Filament panel
27,866 54
Install
composer require devtical/filament-sanctum
Latest Version:v1.1.0
PHP:^8.3
Laravel:12 · 13
Older releases:9
License:MIT
Last Updated:Jul 4, 2026
Links: GitHub  ·  Packagist
Maintainer: Kristories

Filament Sanctum

Manage Laravel Sanctum personal access tokens from your Filament panel.

Create Token Token Created

Installation

Install the package and Sanctum:

composer require devtical/filament-sanctum laravel/sanctum

Publish Sanctum and run migrations:

php artisan vendor:publish --provider="Laravel\Sanctum\SanctumServiceProvider"
php artisan migrate

Add the HasApiTokens trait to your user model:

use Laravel\Sanctum\HasApiTokens;

class User extends Authenticatable
{
    use HasApiTokens;
}

Register the plugin in your Filament panel provider:

use Devtical\Sanctum\SanctumPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        // ...
        ->plugin(SanctumPlugin::make());
}

Publish the package config (optional):

php artisan vendor:publish --tag=filament-sanctum-config

Publish translations (optional):

php artisan vendor:publish --tag=filament-sanctum-translations

Configuration

Navigation

By default, the Sanctum page appears in the user menu. To show it in the sidebar instead:

// config/filament-sanctum.php
'navigation' => [
    'slug' => 'sanctum',
    'sidebar_menu' => [
        'enabled' => true,
    ],
    'user_menu' => [
        'enabled' => false,
    ],
],

Abilities

Customize the abilities available when creating a token:

'abilities' => [
    'columns' => 4,
    'allow_expiration' => true,
    'default_expiration_days' => 30,
    'expiration_presets' => [7, 30, 60, 90],
    'list' => [
        'posts:read' => 'Read posts',
        'posts:write' => 'Write posts',
    ],
],

Authorization

Restrict access to the Sanctum page using a Laravel gate:

'authorization' => [
    'enabled' => true,
    'gate' => 'manage-api-tokens',
],

Define the gate in a service provider:

Gate::define('manage-api-tokens', fn (User $user) => $user->isAdmin());

Testing

composer test

Format code:

composer format

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email w.kristories@gmail.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

Related Packages

webbingbrasil/filament-copyactions

A easy-to-use copy actions for Filament Admin.

915,914 93
webbingbrasil/filament-maps

Map components for Filament.

61,737 78
bostjanob/filament-file-manager

Filament File Manager

5,727 4
dejodev/page-blocks

Simple page blocks blocks package for Filament

1,982 0
heloufir/filament-workflow-manager

Manage your own workflows with filament

1,280 70

Version History

Version Released PHP Laravel License
v1.1.0 ^8.3 ^12.0|^13.0 MIT
1.0.0 ^8.3 12.* MIT
v0.0.6 MIT
v0.0.5 MIT
v0.0.4 ^9.0 MIT