Close Menu
    DevStackTipsDevStackTips
    • Home
    • News & Updates
      1. Tech & Work
      2. View All

      Sunshine And March Vibes (2025 Wallpapers Edition)

      May 16, 2025

      The Case For Minimal WordPress Setups: A Contrarian View On Theme Frameworks

      May 16, 2025

      How To Fix Largest Contentful Paint Issues With Subpart Analysis

      May 16, 2025

      How To Prevent WordPress SQL Injection Attacks

      May 16, 2025

      Microsoft has closed its “Experience Center” store in Sydney, Australia — as it ramps up a continued digital growth campaign

      May 16, 2025

      Bing Search APIs to be “decommissioned completely” as Microsoft urges developers to use its Azure agentic AI alternative

      May 16, 2025

      Microsoft might kill the Surface Laptop Studio as production is quietly halted

      May 16, 2025

      Minecraft licensing robbed us of this controversial NFL schedule release video

      May 16, 2025
    • Development
      1. Algorithms & Data Structures
      2. Artificial Intelligence
      3. Back-End Development
      4. Databases
      5. Front-End Development
      6. Libraries & Frameworks
      7. Machine Learning
      8. Security
      9. Software Engineering
      10. Tools & IDEs
      11. Web Design
      12. Web Development
      13. Web Security
      14. Programming Languages
        • PHP
        • JavaScript
      Featured

      The power of generators

      May 16, 2025
      Recent

      The power of generators

      May 16, 2025

      Simplify Factory Associations with Laravel’s UseFactory Attribute

      May 16, 2025

      This Week in Laravel: React Native, PhpStorm Junie, and more

      May 16, 2025
    • Operating Systems
      1. Windows
      2. Linux
      3. macOS
      Featured

      Microsoft has closed its “Experience Center” store in Sydney, Australia — as it ramps up a continued digital growth campaign

      May 16, 2025
      Recent

      Microsoft has closed its “Experience Center” store in Sydney, Australia — as it ramps up a continued digital growth campaign

      May 16, 2025

      Bing Search APIs to be “decommissioned completely” as Microsoft urges developers to use its Azure agentic AI alternative

      May 16, 2025

      Microsoft might kill the Surface Laptop Studio as production is quietly halted

      May 16, 2025
    • Learning Resources
      • Books
      • Cheatsheets
      • Tutorials & Guides
    Home»Development»Token Forge

    Token Forge

    December 23, 2024

    Token Forge

    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 appeared first on Laravel News.

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

    Source: Read More 

    Facebook Twitter Reddit Email Copy Link
    Previous ArticleWorking with JSON Attributes Using Laravel’s Array Casts
    Next Article Bucket Field in Salesforce: Simplify Your Data Categorization

    Related Posts

    Machine Learning

    Salesforce AI Releases BLIP3-o: A Fully Open-Source Unified Multimodal Model Built with CLIP Embeddings and Flow Matching for Image Understanding and Generation

    May 16, 2025
    Security

    Nmap 7.96 Launches with Lightning-Fast DNS and 612 Scripts

    May 16, 2025
    Leave A Reply Cancel Reply

    Continue Reading

    LambdaTest Review 2024 – Features, Pricing, Pros & Cons

    Development

    How does Business Process Automation Improve Workflow Efficiency?

    Development

    Discover Mindfulness, Leadership, and Professional Skills to Enhance your Career

    Development

    Canva just dropped 6 exciting AI features in its biggest update in years

    News & Updates

    Highlights

    Development

    Proactive Health Plan Advocacy: How Anticipating Member Needs Benefits Everyone

    January 20, 2025

    As noted by Bridget Van Kralingen, a senior vice president at IBM, “The last best…

    CVE-2025-32890 – goTenna Mesh Plaintext Injection Vulnerability

    May 1, 2025

    CodeSOD: Message Oriented Database

    April 15, 2025

    DeepSeek AI Releases DeepGEMM: An FP8 GEMM Library that Supports both Dense and MoE GEMMs Powering V3/R1 Training and Inference

    February 26, 2025
    © DevStackTips 2025. All rights reserved.
    • Contact
    • Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.