bezhanSalleh / filament-shield

The easiest and most intuitive way to add access management to your Filament Admin Resources, Pages & Widgets through `spatie/laravel-permission`

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Documentation Update for Laravel 11 - Custom folder structure for Models or Third-Party Plugins

Solankill opened this issue · comments

Regarding Custom folder structure for Models or Third-Party Plugins. With Laravel 11, you must now do this.

`namespace App\Providers;

use Illuminate\Support\Facades\Gate;
use Illuminate\Support\ServiceProvider;
use RickDBCN\FilamentEmail\Models\Email;
use App\Policies\EmailPolicy;

class AuthServiceProvider extends ServiceProvider
{
public function boot()
{
$this->registerPolicies(); // Manually register policies

    // Manually define gates or policies if needed
    Gate::policy(Email::class, EmailPolicy::class);

}

protected function registerPolicies()
{
    // Manually register each policy
    Gate::policy('RickDBCN\FilamentEmail\Models\Email', 'App\Policies\EmailPolicy');
}

public function register()
{
    //
}

}
`

This aint an issue, you could submit a pr to update the docs