basic-app / admin-auth-shield
dev-main
2026-11-13 14:17 UTC
Requires
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-11-13 14:17:30 UTC
README
Install
-
Install Shield
-
Run
composer require basic-app/admin-auth-shield
- Add to "Config/Routes.php"
helper(['admin_auth_shield']);
if (!admin_auth_shield_routes($routes))
{
// default auth routes
service('auth')->routes($routes);
}
- Add to "Config/Filters.php"
public array $aliases = [
/* other aliases here... */
'adminsession' => \BasicApp\AdminAuthShield\Filters\AdminSessionAuth::class,
'admingroup' => \BasicApp\AdminAuthShield\Filters\AdminGroupFilter::class
];
public array $filters = [
/* other filters here... */
'adminsession' => [
'before' => [
'admin',
'admin/*'
]
],
'admingroup:admin' => [
'before' => [
'admin',
'admin/*'
]
]
];
- Add to "Config/Services.php"
public static function adminAuth($getShared = true)
{
if ($getShared) {
return static::getSharedInstance(__FUNCTION__);
}
return new \BasicApp\AdminAuthShield\Services\AdminAuth;
}
- Add to ".env"
Security.csrfProtection="session"
- Add to "Config\Autoload"
public $helpers = [
/* other helpers here... */
'auth',
'setting'
];
- Run
php spark db:seed "BasicApp\AdminAuthShield\Database\Seeds\DemoSeeder"
Access backend by opening http://localhost:8080/index.php/admin in a browser.
login: admin@example.org
password: admin