Skip to content

How to add permissions and roles to filament-blog with Shield plugin #42

@benib3

Description

@benib3

Hello everyone,
I have seen somewhere people struggled to add permissions and roles for this plugin as I did also... So I found a way how to add to filament blog plugin permissions and roles using also widely popular Shield plugin, it might not be convenient way but it works for me.

  1. Copy resources provided from filament-blog ( Me personally created a command to copy from vendor all resources )
    image
  2. When copied run php artisan shield:generate --all and it will generate policies with coresponding resources from filament-blog
  3. Most important is to add Gate Policies if u use Laravel 11^ its in AppServiceProvider.php
    image
  4. Optionaly u can add also HasShieldPermissions interface to resources.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions