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
Solution:
Thanks for your reply.
<?php
'show_model_path' => false,
?>
<?php
'show_model_path' => false,
?>
...
Jump to solution
7 Replies
Vp
Vp7mo ago
iirc the permission label uses resource label, you can try changing yours or more info ask here #bezhansalleh-shield
Sourabh
Sourabh6mo ago
Hi, Have you got any solutions for this? so please share.
Ethan Creft
Ethan CreftOP6mo 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
micraux6mo 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
Sourabh6mo 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
kobby
kobby6mo ago
Fixed mine by publishing the config
php artisan vendor:publish --tag=filament-shield-config
php artisan vendor:publish --tag=filament-shield-config
The you can turn feature on and off in filament-shield.php file
Solution
Sourabh
Sourabh6mo ago
Thanks for your reply.
<?php
'show_model_path' => false,
?>
<?php
'show_model_path' => false,
?>
Want results from more Discord servers?
Add your server