Back to list
iurygdeoliveira

scaffold-policy

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-policy description: Automates the creation of Laravel Policies with strict typing and Role/Permission integration.

Laravel Policy Scaffold Skill

Use this skill when defining authorization logic.

Rules

1. User Type

  • Always type hint the User model explicitly: public function update(User $user, Post $post): bool.

2. Permissions vs Roles

  • Prefer Permissions: Use $user->can('update posts') rather than hardcoded role checks like $user->role == 'admin'.
  • Super Admin: Remember that specific packages (like Spatie Permission) might handle Super Admin auto-approval via Gate. Ensure before() method usage if manual override is needed.

3. Filament Integration

  • Filament relies heavily on Policies. Ensure all methods (viewAny, view, create, update, delete, restore, forceDelete) are implemented.
  • Return false by default for methods that shouldn't be accessed.
public function viewAny(User $user): bool
{
    return $user->can('view_any_post');
}

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