Download the PHP package blaspsoft/token-forge without Composer

On this page you can find all versions of the php package blaspsoft/token-forge. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package token-forge

Total Downloads Latest Version License

Token Forge - API Token Management for Laravel Breeze

blaspsoft/token-forge is a Laravel package that adds robust, customizable API token management to your application, inspired by Laravel Jetstream. Token Forge allows you to create, manage, and monitor API tokens with ease, providing secure access control for your API.

Note: This package supports both the Blade and Inertia Vue Laravel Breeze stacks.

Features

Requirements

This package requires the following dependencies:

Install Laravel Breeze with the relevant stack:

Install Laravel Sanctum:

Then install the front-end dependencies:


Installation

Install the package via Composer:

After installing the package, publish the configuration file:

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


Setup Instructions

1. Install the Stack

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

This command will:


2. Sanctum Setup

Ensure that Laravel Sanctum is properly configured. Make sure the HasApiTokens trait is added to your User model:

Additionally, ensure that Sanctum's setup command is run to install its configuration and migrations:


3. Middleware Configuration (Inertia Vue Only)

To ensure that Token Forge integrates smoothly with your Inertia responses, modify your HandleInertiaRequest.php middleware file as follows:

Add the following block to the share method in app/Http/Middleware/HandleInertiaRequest.php:

This setup enables Token Forge to flash token information to your Inertia responses, allowing you to use the token in your Vue components.


4. API Token Management Routes

The routes provided by Token Forge implement the TokenForgeController interface, allowing flexibility for different stacks. The interface is automatically resolved to the correct implementation (Blade or Vue) based on the installation.

Here are the available routes:

Method URI Interface Method Description
GET /api-tokens index Display the API tokens list
POST /api-tokens store Create a new API token
PUT /api-tokens/{token} update Update an existing API token
DELETE /api-tokens/{token} destroy Delete an API token

These routes provide a complete interface to generate, view, and revoke API tokens through a consistent REST API.


Configuration

The package configuration is located in config/token-forge.php. Here are the default values:

Default Permissions

These are the default permissions assigned to new API tokens if no specific permissions are provided during creation.

Available Permissions

These are the permissions available to assign to API tokens. You can modify these values to fit your application’s needs.

If you wish to change the default or available permissions, publish the configuration file using:

Then, update the config/token-forge.php file to reflect your desired permissions.


Final Step: Build Assets

After completing the setup, ensure your front-end assets are compiled. You can use one of the following commands:

This will ensure the necessary assets are available for the API token management UI.


Screenshots


License

This package is open-source software licensed under the MIT license.


All versions of token-forge with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
inertiajs/inertia-laravel Version ^1.0
laravel/sanctum Version ^4.0
laravel/breeze Version ^2.2
illuminate/support Version ^8.0|^9.0|^10.0|^11.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package blaspsoft/token-forge contains the following files

Loading the files please wait ....