nanopanda
Unconventional Pivot table name. How to tell the Relation manager to use this table name ?
@taz have you tried passing in the table name to your belongsToMany() call? Something like:
return $this->belongsToMany( Customer::class, 'chatting_instances' )->...
6 replies
Using Filament Notification number in Frontpage notification icon
Are you using Laravel Database Notifications? See here: https://laravel.com/docs/11.x/notifications#accessing-the-notifications
7 replies
Allow Relation Manager to to link to the `view` page rather than open a modal
@andyov You can modify the EditAction url to do something like this, where "yourpanelname" is your Filament panel's route name, and "relation_resource_name" is your child Resource's route name. Artisan route:list will give you the exact route path if you need to check it.
Tables\Actions\EditAction::make()->url(fn ($record): string => route( 'filament.yourpanelname.resources.relation_resource_name.edit', ['record' => $record ] ) )
5 replies
Error when switching tabs in Relation Manager
@Garrita I encountered this the other day after upgrade to 3.2.87. What is your Filament version? I upgraded to .88, removed public/js/filament and ran artisan filament:upgrade and now it's working again
5 replies
Filament Shield
@Hasbullah you can add one, or even just add a "Gate::policy( 'Model\Name', 'Policy\Name' )" to your AppServiceProvider boot for a quick test. To register your own provider, add to /Bootstrap/providers.php. If you extend "Illuminate\Foundation\Support\Providers\AuthServiceProvider", you only need to override the $policies []. You can take a look at the core AuthServiceProvider to see how it registers everything in $policies with Gate. Anyhow, something like this should do it:
<?php
namespace App\Providers;
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
class AuthServiceProvider extends ServiceProvider
{
protected $policies = [
'Spatie\Permission\Models\Role' => 'App\Policies\RolePolicy',
];
}
5 replies
Filament Shield allows create/edit/delete despite role restrictions. Shouldn't have these permission
Perhaps "shield:generate --all" was run during installation? When you add new Models/Resources you need to rerun in order to generate a Policy
7 replies