amirilidan78/auth-token is a Laravel package for simple laravel authentication package.
It currently has 0 GitHub stars and 8 downloads on Packagist.
Install it with composer require amirilidan78/auth-token.
Discover more Laravel packages by amirilidan78
or browse all Laravel packages to compare alternatives.
Last updated
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_tokenUse this function for creating token
Function returns token : string
Acceptable request header Auth {$token}
AuthService::get_auth_token_from_requestFunction extract authentication token from user request
Function returns authentication token : string|null
AuthService::validate_tokenFunction validate request auth token you should specify guard for this function, guard is string like user, admin, ...
Function returns authentication token : string|null
AuthService::logoutFunction delete authentication token from database
Function returns authentication token : string|null
AuthService::remove_expired_auth_tokensFunction removes all expired tokens, expire token config key is token_auth.token_expire_minutes
Function returns authentication token : string|null
Middleware::authenticationUse middleware authentication with guard for secure routes
Example ->middleware(['authentication:user'])