Back to list
iurygdeoliveira

scaffold-controller

by iurygdeoliveira

Repositorio destinado a fornecer um kit inicial para desenvolvimento de SaaS usando laravel e filament

29🍴 12📅 Jan 20, 2026

SKILL.md


name: scaffold-controller description: Enforces "Skinny Controllers" pattern, requiring FormRequests for validation and Services for complex logic.

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.

2. Method Structure

  • Controllers should only coordinate flow: Input -> Service/Model -> Output.
  • Complex business logic belongs in a Service Class (use service-pattern skill).

3. 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);
    // ...
}

4. Dependency Injection

  • Inject Services into the constructor or method signature.
public function __construct(
    protected UserService $userService
) {}

Score

Total Score

80/100

Based on repository quality metrics

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

+10
説明文

100文字以上の説明がある

+10
人気

GitHub Stars 100以上

0/15
最近の活動

1ヶ月以内に更新

+10
フォーク

10回以上フォークされている

+5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

+5

Reviews

💬

Reviews coming soon