amirilidan78 / auth-token
simple laravel authentication package
Installs: 8
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
pkg:composer/amirilidan78/auth-token
This package is auto-updated.
Last update: 2026-01-11 15:49:14 UTC
README
simple laravel authentication package
Install
composer require amirilidan78/auth-token:dev-main
Publish migrations
php artisan vendor:publish --tag=auth-token-migration
Publish config file
php artisan vendor:publish --tag=auth-token-config
Docs
import AuthService from Amirilidan78\AuthToken\Services
AuthService::create_auth_token
Use this function for creating token
Function returns token : string
Acceptable request header Auth {$token}
AuthService::get_auth_token_from_request
Function extract authentication token from user request
Function returns authentication token : string|null
AuthService::validate_token
Function validate request auth token you should specify guard for this function, guard is string like user, admin, ...
Function returns authentication token : string|null
AuthService::logout
Function delete authentication token from database
Function returns authentication token : string|null
AuthService::remove_expired_auth_tokens
Function removes all expired tokens, expire token config key is token_auth.token_expire_minutes
Function returns authentication token : string|null
Middleware::authentication
Use middleware authentication with guard for secure routes
Example ->middleware(['authentication:user'])