daikazu / simple-token-middleware
A simple token middleware
Package info
github.com/daikazu/simple-token-middleware
pkg:composer/daikazu/simple-token-middleware
Requires
- php: >=7.0
- illuminate/support: ~5.7
Requires (Dev)
- orchestra/testbench: ~3.8
- phpunit/phpunit: ^8.0
This package is auto-updated.
Last update: 2026-03-19 19:00:37 UTC
README
Small package to quickly add custom middleware to your laravel app to easily restrict access to your routes.
Installation
Install via composer
composer require daikazu/simple-token-middleware
Register Service Provider
Note! This and next step are optional if you use laravel>=5.5 with package auto discovery feature.
Add service provider to config/app.php in providers section
Daikazu\SimpleTokenMiddleware\ServiceProvider::class,
Register Facade
Register package facade in config/app.php in aliases section
Daikazu\SimpleTokenMiddleware\Facades\SimpleTokenMiddleware::class,
Publish Configuration File
php artisan vendor:publish --provider="Daikazu\SimpleTokenMiddleware\ServiceProvider" --tag="config"
Usage
Add SIMPLE_TOKEN=my_secret_token to your .env file,
use the middleware name simple.token in your route assignment.
Route::post('/api/my-protected-route', 'Controller@index')->middleware('simple.token');
Security
If you discover any security related issues, please email instead of using the issue tracker.
Credits
This package is bootstrapped with the help of melihovv/laravel-package-generator.