Gaurav
same model policy: multiple resources
I think this question was for me. Here is a sample:
and then,
Here
AccountPolicy
has inherited all the methods from ModelPolicy
with appropriate customizations through static variables. And custom policy method or overrides are specified in the derived policy, such as setOpeningBalance
in this case.13 replies
fillForm on Create Page?
2 things:
1.
form(self::form())
doesn't work as self::form requires a from argument. So, I've used form(fn (Form $form) => static::form($form->model(static::$model))->columns(2))
instead
2. It creates a new record with old values, and updated the existing record with new values30 replies
fillForm on Create Page?
I believe there will be a couple of more steps required in case of a generic action, such as letting filament know what to do when the form has been filled, via some action buttons. May as well need to create a separate page for this, similar to edit page.
30 replies
fillForm on Create Page?
That's what I eventually ended up using. Though the reason I didn't want to was that in some cases plain replication would result in duplication of unique required attributes. I'm using simple resource (pop-up forms) in such cases. A better (more consistent) solution would be appreciated though.
30 replies