Download the PHP package blaspsoft/keysmith-vue without Composer
On this page you can find all versions of the php package blaspsoft/keysmith-vue. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download blaspsoft/keysmith-vue
More information about blaspsoft/keysmith-vue
Files in blaspsoft/keysmith-vue
Package keysmith-vue
Short Description A Vue & Inertia-powered API key management system for Laravel 12 Vue Starterkit, with secure token generation, revocation, and authentication.
License MIT
Homepage https://github.com/blaspsoft/keysmith-vue
Informations about the package keysmith-vue
Keysmith Vue - Laravel 12 Vue Starterkit API Token Management
Keysmith Vue is a Laravel 12 Vue Starterkit package that provides Vue.js components for managing API keys and tokens in your application. It offers a clean, user-friendly interface for creating, viewing, and revoking API keys with customizable permissions based on the implementation from Laravel Breeze.
Features
- 🔑 Easy API token generation and management
- 🔒 Built on Laravel Sanctum's secure token authentication
- 🎨 Pre-built Vue components for quick integration
- 📱 Responsive and user-friendly interface
- ⚙️ Flexible installation options (page or settings templates)
- 🛠️ Customizable permissions system
Requirements
- PHP 8.2 or higher
- Laravel 12.x
- Vue 3.x
- Laravel Sanctum
Installation
You can install the package via composer:
Choose your preferred installation template:
Page Template
Install this option to add a dedicated API tokens page at pages/api-tokens/index.vue
. This provides a standalone interface for managing your API tokens.
Settings Template
Choose this option to integrate API token management within your Laravel Vue Starterkit settings at pages/settings/APITokens.vue
. This keeps token management alongside your other application settings.
Run one (or both) of the following commands based on your choice:
or
Configure Inertia Middleware
Add the following to your HandleInertiaRequests.php
middleware's share
method to handle API token flash messages:
This configuration is required to display newly created API tokens to users.
Add navlinks to starterkit templates
Dependent of which template you decide to use 'page" or "settings" (or both). You may want to add links to the app sidebar and settings navigations.
For the page update js/components/AppSidebar.vue
For the settings update js/layouts/settings/Layout.vue
Publish config [optional]
This command will publish a configuration file at config/keysmith.php
, where you can customize keysmith settings.
Dependencies
This package requires Laravel Sanctum for API token authentication. Before using Keysmith Vue, make sure to:
-
Install Laravel Sanctum:
-
Publish and run Sanctum's migrations:
- Add the HasApiTokens trait to your User model:
Components
Keysmith Vue provides two components that are installed in your /components
directory:
CreateApiTokenForm.vue
: Form component for generating new API tokensManageApiTokens.vue
: Component for viewing and managing existing tokens
These components are utilized in both the page and settings templates.
Routes
Keysmith Vue provides two sets of routes depending on your installation choice:
Page Template Routes
If you installed using the page template (keysmith:install page
), these routes are available:
Settings Template Routes
If you installed using the settings template (keysmith:install settings
), these routes are available:
All routes are protected by authentication middleware and handle the following operations:
GET
: Retrieve all tokens for the authenticated userPOST
: Create a new API tokenPUT
: Update token permissionsDELETE
: Revoke an existing token
Testing
Keysmith Vue includes test files that are placed in your project's tests/Feature/ApiToken
directory:
PageTokenTest.php
: Tests for the page template implementationSettingsTokenTest.php
: Tests for the settings template implementation
You can run the tests using:
Customizing Permissions
You can customize the available token permissions by modifying the config/keysmith.php
file:
Screenshots
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Credits
- Michael Deeming
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of keysmith-vue with dependencies
inertiajs/inertia-laravel Version ^2.0
laravel/sanctum Version ^4.0
illuminate/support Version ^12.0