scaffold-policy

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

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 .
  1. 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.

  1. 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'); }

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

scaffold-listener

No summary provided by upstream source.

Repository SourceNeeds Review