Pulpsting0610
Dynamically change defaultItems in Repeater
I have a repeater->make('numbers.winning_numbers') and another select component.
Default Items in repeater is 2. But whenever the select component is updated, default items in repeater needs to be changed.
I think this can be achieved by using live() and afterStateUpdated hook in select component but I just can use $set to set the defaultItems in repeater.
Any help?
1 replies
Is it possible to show two unrelated texts in a single table column?
I have user.username and user.roles.name. Two different columns. Both are text columns where roles.name is list separated badge text column.
Is there anyway to show these in stack in single column.
I used Split and Stack layout but it is not applicable. I need a normal table with these two column stack at each other like this:
test_username
[admin]
Where admin is a badge.
6 replies
Explicitly define which policy to use in filament resource?
Here is my setup:
I have a regular User model. I have Superadmin and Admin classes which extend the User class.
I have set global scope in Superadmin and Admin class to filter out by role super-admin and admin.
I also override the getMorphClass in User model to return User class always.
This setup worked for me until I ran into filament.
Now filament uses model policies for authorization.
I have created UserPolicy, SuperadminPolicy, AdminPolicy.
In my app superadmins can create, update, delete and view admins. So, I have configured my policy like this.
Now filament comes in, I login to superadmin panel. I can see, view and create admins. I am also able to see edit record button in the table. I can go to edit record page also. When i hit the SAVE button, BOOM it throws me 403 unauthorized.
I traced back the 403 exception and found out that filament is looking into update action of UserPolicy which is different from AdminPolicy.
Is there any way to tell filament that it should look into AdminPolicy instead of UserPolicy
7 replies