scaffold-middleware

Laravel Middleware Pattern Skill

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "scaffold-middleware" with this command: npx skills add iurygdeoliveira/labsis-kit/iurygdeoliveira-labsis-kit-scaffold-middleware

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.php using the ->withMiddleware() callback.

  • Use append() for global or alias() for route-specific.

->withMiddleware(function (Middleware $middleware) { $middleware->append(EnsureTokenIsValid::class); $middleware->alias([ 'admin' => EnsureUserIsAdmin::class, ]); })

  1. Structure
  • Implement the handle method with proper typing.

public function handle(Request $request, Closure $next): Response { if (...) { return redirect('/home'); } return $next($request); }

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

scaffold-filament-resource

No summary provided by upstream source.

Repository SourceNeeds Review
General

scaffold-controller

No summary provided by upstream source.

Repository SourceNeeds Review
General

scaffold-filament-page

No summary provided by upstream source.

Repository SourceNeeds Review
General

style-components

No summary provided by upstream source.

Repository SourceNeeds Review