How can I change the Label of Permission (Shield)

Hello, I am using the Filament Shield plugin, if I create 2 Resources in 1 Model, how can I change the Label of Permission? Example: Ticket (Request for quotation), Ticket (Web Maintenance)
No description
5 Replies
Vp
Vp4w ago
iirc the permission label uses resource label, you can try changing yours or more info ask here #bezhansalleh-shield
Sourabh
Sourabh6d ago
Hi, Have you got any solutions for this? so please share.
Ethan Creft
Ethan Creft5d ago
I create 2 Model for 2 Resources use App\Models\Ticket; class ModelNameOne extends Ticket { protected $table = 'tickets'; } class ModelNameTwo extends Ticket { protected $table = 'tickets'; }
micraux
micraux5d ago
You can try to (re)name your second resource like this:
// In your XxxxResource.php file
protected static ?string $modelLabel = 'any label you want';
// In your XxxxResource.php file
protected static ?string $modelLabel = 'any label you want';
Sourabh
Sourabh3d ago
Thank you both for your help. My permission label has been updated, but I'm encountering an issue: when I disable any permission for Disabled Products, the permissions for Enabled Products also change. I'll try your suggestion to create two models for the two resources, similar to how Ticket works. Can I able to remove model path as well ?
No description