scaffold-middleware
SKILL.md
Laravel Middleware Pattern Skill
Use this skill when implementing request filtering or modification logic.
Rules
1. Modern Registration (Laravel 12)
- Do NOT look for
app/Http/Kernel.php(it is gone). - Register middleware in
bootstrap/app.phpusing the->withMiddleware()callback. - Use
append()for global oralias()for route-specific.
->withMiddleware(function (Middleware $middleware) {
$middleware->append(EnsureTokenIsValid::class);
$middleware->alias([
'admin' => EnsureUserIsAdmin::class,
]);
})
2. Structure
- Implement the
handlemethod with proper typing.
public function handle(Request $request, Closure $next): Response
{
if (...) {
return redirect('/home');
}
return $next($request);
}
Weekly Installs
3
Repository
iurygdeoliveira…bsis-kitGitHub Stars
31
First Seen
Jan 24, 2026
Security Audits
Installed on
claude-code2
windsurf1
trae1
opencode1
codex1
antigravity1