Closed MarJose123 closed 2 years ago
Hi, filament-shield should already automatically pickup the ActivityResource
from this package and generate permissions for it.
However you'd need to manually hook up the policy generated by shield to spaites Activity
Model
Is this what you are asking or have i misunderstood the question?
the policy generated by shield to spaites Activity Model is already in there but the Resource is still showing up.
However you'd need to manually hook up the policy generated by shield to spaites Activity Model.
Since Activity Model is in a package laravel doesn't automatically pickup the policy for it
Do this in your AuthServiceProvider
and it should work
<?php
namespace App\Providers;
use Spatie\Activitylog\Models\Activity;
use App\Policies\ActivityPolicy;
class AuthServiceProvider extends ServiceProvider
{
protected $policies = [
Activity::class => ActivityPolicy::class, // <- add this
];
public function boot()
{
$this->registerPolicies();
}
}
Allow to add use HasPageShield; traits based on this documentation.
https://github.com/bezhanSalleh/filament-shield#pages