Token Forge - API Token Management with Laravel Breeze

Token Forge by Blaspsoft, is a versatile Laravel package designed to add robust, customizable API token management to your application. The package is inspired by Laravel Jetstream’s token implementation but for users of Laravel Breeze. Key Features The key features of this package include: Token Management: Create, update, and revoke API tokens with ease. Permission Control: Define granular permissions for tokens. Activity Monitoring: Monitor token usage and activity for better security. Integration: Works with Laravel's authentication and session systems. Customization: Supports a configurable interface via a TokenForgeController contract, adapting to specific application needs. Note: This package supports both the Blade and Inertia Vue stacks provided by Laravel Breeze and requires Laravel Sanctum. Before installing Token Forge, ensure the chosen Laravel Breeze stack is installed and properly configured along with Lara

Token Forge - API Token Management with Laravel Breeze


Click the link to join the registration on WhatsApp: https://chat.whatsapp.com/KThkuZlWaTcCu3iJHGBmLM


Click the link to join the registration on WhatsApp: https://chat.whatsapp.com/KThkuZlWaTcCu3iJHGBmLM


Click the link to join the registration on WhatsApp: https://chat.whatsapp.com/KThkuZlWaTcCu3iJHGBmLM

Token Forge - API Token Management with Laravel Breeze

Token Forge by Blaspsoft, is a versatile Laravel package designed to add robust, customizable API token management to your application. The package is inspired by Laravel Jetstream’s token implementation but for users of Laravel Breeze.

Key Features

The key features of this package include:

  • Token Management: Create, update, and revoke API tokens with ease.
  • Permission Control: Define granular permissions for tokens.
  • Activity Monitoring: Monitor token usage and activity for better security.
  • Integration: Works with Laravel's authentication and session systems.
  • Customization: Supports a configurable interface via a TokenForgeController contract, adapting to specific application needs.

Note: This package supports both the Blade and Inertia Vue stacks provided by Laravel Breeze and requires Laravel Sanctum. Before installing Token Forge, ensure the chosen Laravel Breeze stack is installed and properly configured along with Laravel Sanctum.

Assuming those dependencies are already installed and configured properly, you can install Token Forge using composer:

composer require blaspsoft/token-forge
php artisan vendor:publish --tag=token-forge-config --force

This will publish a configuration file at config/token-forge.php, allowing you to customize Token Forge settings.

Depending on the Laravel Breeze stack you chose, run the appropriate command to install Token Forge:

# For blade
php artisan token-forge:install blade

#For Vue-Inertia
php artisan token-forge:install vue

If you are using Inertia with Vue, there is an additional change you will need to make in your HandleInertiaRequest.php middleware. This allows Token Forge to flash token information to your Inertia responses thus allowing you to use the token in your Vue components.

public function share(Request $request): array
{
    return [
        ...parent::share($request),
        'auth' => [
            'user' => $request->user(),
        ],
        'flash' => [
            'tokenForge' => [
                'token' => fn () => session()->get('token'),
            ],
        ],
    ];
}

Also in the config/token-forge.php file you will want to specifiy your default and available permissions. For example:

'default_permissions' => [
    'read',
],
'available_permissions' => [
    'create',
    'read',
    'update',
    'delete',
],

Once setup, Token Forge will provide you with routes providing a complete interface to generate, view, and revoke API tokens through a consistent REST API.

Token Forge User Interface Screenshot

You can learn more about this package, get full installation instructions, and view the source code on GitHub.


The post Token Forge - API Token Management with Laravel Breeze appeared first on Laravel News.

Join the Laravel Newsletter to get all the latest Laravel articles like this directly in your inbox.

What's Your Reaction?

like

dislike

love

funny

angry

sad

wow

Keep advertising to get more people

You could reach thousands of more people for every ₦1,000 you spend. https://doacweb.com/advertising

Adverts on doacWeb can be informative, educative or persuasive in nature.

doacWeb Ads is always directed at a broad audience (reaching thousands of people day by day), not few individuals — it deliver your advert to the target audience at the same time. Putting your offer in front of the right people — who have the money and interest in what you sell.

doacWeb Advertising gives you advantage as adverts passes through https://doacweb.com to the internet, reaching millions of people over the internet, and to grow your audience.

Grow your business, Be known, Boost your visibility, Drive engagements, Get new customers and Increase sales.

doacWeb acts as a global advertising media, to let people — individuals — and businesses, to promote and reach more interested people.

Get Started.

WhatsApp: 09031633831

Email: info@doacweb.com
Keep advertising to get more people

You could reach thousands of more people for every ₦1,000 you spend. https://doacweb.com/advertising

Adverts on doacWeb can be informative, educative or persuasive in nature.

doacWeb Ads is always directed at a broad audience (reaching thousands of people day by day), not few individuals — it deliver your advert to the target audience at the same time. Putting your offer in front of the right people — who have the money and interest in what you sell.

doacWeb Advertising gives you advantage as adverts passes through https://doacweb.com to the internet, reaching millions of people over the internet, and to grow your audience.

Grow your business, Be known, Boost your visibility, Drive engagements, Get new customers and Increase sales.

doacWeb acts as a global advertising media, to let people — individuals — and businesses, to promote and reach more interested people.

Get Started.

WhatsApp: 09031633831

Email: info@doacweb.com
Keep advertising to get more people

You could reach thousands of more people for every ₦1,000 you spend. https://doacweb.com/advertising

Adverts on doacWeb can be informative, educative or persuasive in nature.

doacWeb Ads is always directed at a broad audience (reaching thousands of people day by day), not few individuals — it deliver your advert to the target audience at the same time. Putting your offer in front of the right people — who have the money and interest in what you sell.

doacWeb Advertising gives you advantage as adverts passes through https://doacweb.com to the internet, reaching millions of people over the internet, and to grow your audience.

Grow your business, Be known, Boost your visibility, Drive engagements, Get new customers and Increase sales.

doacWeb acts as a global advertising media, to let people — individuals — and businesses, to promote and reach more interested people.

Get Started.

WhatsApp: 09031633831

Email: info@doacweb.com