By default, FilamentPHP provides a convenient ) with a own Permission Service and Enum. Adapt this logic to your own application.
Ideally, Filament would use a dedicated download method instead of view, as these represent different concerns. However, we'll stick with the default behavior for simplicity.
Registering the Policy
Don't forget to register the policy in your service provider:
use Filament\Actions\Imports\Models\Import;
public function boot(): void
{
Gate::policy(Import::class, ImportPolicy::class);
...
}
Creating the Filament Resource
Now let’s expose imports in the admin panel:
php artisan make:filament-resource Import --model-namespace=Filament\\Actions\\Imports\\Models
We don’t need forms here, only a listing page. So you can delete Schemas format and some pages like CreateImport and EditImport
Import's actions with failed rows
I’m sharing production-ready Laravel & Filament setups too (Docker, CI/CD, deployment…).
Join the Early Supporters tier for full access
SOCIAL SHARE CARD GENERATOR