Tieme
2 "save" actions on CreateResource with "mutateFormDataBeforeCreate"
Here is the solution.
Create a Formfield, hide the label and add
hidden
as extraAttributes
For the action, set submit to null
and update the $livewire->data['status']
in action and than create the record.
This will set status to Concept
in my case.
If there is another way i would love to see it.
Because this works, but dont think this is the best way of doing this.11 replies
2 "save" actions on CreateResource with "mutateFormDataBeforeCreate"
So i need to duplicate the create function to only change 1 attribute that needs to be changed?
Just like below where i added the
$data['status'] = InternalProjectStatus::CONCEPT->value;
Isent there a better way to do this?
11 replies
custom field appends error when sum using summariz
i think you need a query for that.
Summarize does a query to the database, that is why it is not working.
https://filamentphp.com/docs/3.x/tables/summaries#scoping-the-dataset
->query(fn (Builder $query) => $query->where('is_published', true))
4 replies
widget doesin't update when i use the filter on a table help please
Have you completed the setup by reading the docs : https://filamentphp.com/docs/3.x/panels/resources/widgets#accessing-page-table-data-in-the-widget
3 replies
is it possible to add dividers in a grouped action blade / livewire component?
Yes this it possible.
You can checkout all the code of fillament on Github and start looking how it should be done,
Below is the code you can find in https://github.com/filamentphp/filament/blob/2f5ac6078d522672a437b56d573a78ecf869a67a/docs-assets/app/resources/views/livewire/actions.blade.php#L106-L114
4 replies
Filament Serial Number generator
Checkout : https://laravel.com/docs/11.x/strings#method-str-ulid or https://laravel.com/docs/11.x/strings#method-str-uuid
4 replies
Use 1 attribute for 2 SelectFilter
You cant use same "id's" with filter.
you need to change one "product_id" to somethin like "product_name"
and than set a attribute "product_id" https://filamentphp.com/docs/3.x/tables/filters/select#customizing-the-column-used-by-a-select-filter
3 replies
Attachments concept tips
Depends on more than that.
i have a applications where 2 models have a total of 3 images per record.
I defined the imaged in that model.
Als other applications where almost all models / records can have attachments.
There i have a morph to.
4 replies
Image Gallery On Modal like ImageColumn
Maybe a litle detour to a CheckboxList?
Here you can create the options with a image as description https://filamentphp.com/docs/3.x/forms/fields/checkbox-list#setting-option-descriptions
5 replies
Data is not getting saved in db after tranferring one form data to another
Hi,
first a sidenote, please don't use route when creating a url to a resource.
Read the following https://filamentphp.com/docs/3.x/panels/resources/getting-started#generating-urls-to-resource-pages
Are you getting any errors?
Is your form populated with all the data you want?
Because what you are doing is not changing data before safe you need to use https://filamentphp.com/docs/3.x/panels/resources/creating-records#customizing-data-before-saving for that.
Your action is before filling the form, so is the form populated with data?
5 replies
Hidden field works only while create and not edit
@Soundmit i hade the same issue.
I have cast on the model and use a "helper function" so it will work on create and edit form
sidenote : All my enums are numeric so possible the code can be optimzed to meet you needs.
Somethin like instance of enum
11 replies