Disable resource form while editing but enable relation managers?
Is this possible without manually disabling each field? What would be the best approach for this?
4 Replies
Update: we've manually disabled each field in the form for now. Not sure if there is a better way. π€
You could wrap your form inputs in a Group and add
->disabled()
on that group, but why?
$form->disabled()
Bump.
I've also used disabled for this as well.
Then I would use a policy as a conditional lfor the form to be disabled....
Trickling down this would conflict with Filemanet inheriting the policies, So I add a custom policy functtion canManageModelFields, canManageModelRelationShips,
then the user is allowed to edit the title, yet not the addresses (relation), but tthey are allowed to edit the 'links' relationship....
Sorry for the typos.... It's Friday and I had to deploy today π
To summarize my question on this: Do you have any tips on solving granular customisation through polices in filament (so the rest of my app can follow )?
Kind Regards, Y .