-
Notifications
You must be signed in to change notification settings - Fork 0
Middleware
AngelNovo edited this page Aug 14, 2024
·
2 revisions
use lib\middleware\Middleware;
/*
define_essentials() will create the following middlewares
Simple-Auth, Bearer-Auth
*/
Middleware::define_essentials();
/**
@param $class must be with the following notation: ClassName::class
The function to verify the middleware must be static
*/
Middleware::define(string $key, $class, string $function);
Middleware::on(string $key, callable $closure_containing_routes);
Middleware::on('Simple-Auth', function() {
Route::Get('/', Index::class, 'GetIndexView');
});