scaffold-controller

Laravel Controller 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-controller" with this command: npx skills add iurygdeoliveira/labsis-kit/iurygdeoliveira-labsis-kit-scaffold-controller

Laravel Controller Pattern Skill

Use this skill when creating or refactoring Controllers.

Rules

  1. Verification First
  • Always create a Form Request class for validation. Never write validation logic ($request->validate() ) inside the controller.

  • Always use Resource Classes for API responses.

  1. Method Structure
  • Controllers should only coordinate flow: Input -> Service/Model -> Output.

  • Complex business logic belongs in a Service Class (use service-pattern skill).

  1. Route Model Binding & Typing
  • Use Implicit Binding by matching the route parameter name {user} with the controller argument $user .

  • Type hint the Model (User $user) and the Form Request (StoreUserRequest $request) .

// Route: Route::get('/users/{user}', [UserController::class, 'show']);

public function show(User $user): Response { return view('users.show', ['user' => $user]); }

public function store(StoreUserRequest $request) { $data = $request->validated(); User::create($data); // ... }

  1. Dependency Injection
  • Inject Services into the constructor or method signature.

public function __construct( protected UserService $userService ) {}

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-filament-page

No summary provided by upstream source.

Repository SourceNeeds Review
General

scaffold-service

No summary provided by upstream source.

Repository SourceNeeds Review
General

optimize-livewire-component

No summary provided by upstream source.

Repository SourceNeeds Review