tjodalv
Action inside modal is not working
Just to post an update how I solved this problem. The problem was my misuse of Filament actions.
I've created new Livewire component in which created filament table, just like the documentation says. I've passed my invoice record to the livewire via property.
And in the modal content view I called the livewire component like this:
And finally Action that opens that modal:
12 replies
Action inside modal is not working
Hi Saade, thank you for your help. I've refactored my code like this:
And in the view:
In the view I am renaming the button so it has unique name and assign record to be payment. There is no error, but that delete button is still not working. The record is not deleted in the database when the button is clicked.
12 replies
Action inside modal is not working
As I am using remove payment button inside of the for loop I created a function that constuct DeleteAction button for every row like this, but still doesn't work:
And then in view my loop goes like this:
But that still doesn't work for some reason.
12 replies
Modal in form Resource
The best candidate for what you are trying to achieve would be hint action. Basically on any field you can define hint action that can open the modal with instructions:
More on hint actions here:
https://filamentphp.com/docs/3.x/forms/actions#passing-multiple-hint-actions-to-a-field
5 replies
ViewAction on resource's table listing page
I've manage to find the solution to my problem using
mountUsing()
method on an action by inspecting how ViewAction works in the Filament. This is my solution:
In my form()
method I am calling my custom class UserForm
that define fields for this action and for my UserResource
class.9 replies
ViewAction on resource's table listing page
Oh yes and I also tried to use Filament\Actions\ViewAction instead of Filament\Tables\Actions\ViewAction but that didn't work either. If I use Filament\Tables\Actions\ViewAction, when clicking on, it opens view estimate page (I want to open user linked to estimate) and if I use Filament\Actions\ViewAction then nothing happens when clicking the button.
9 replies
customize creating related model in Select form component when using createOptionForm()
I didn't find a proper way to update my model after being created through Select component but I've managed to achieve what I wanted by using method
afterStateUpdated()
on Select form component and then checking if my Partner doesn't have assigned any type then assign the type that I want to be assigned. See an example:
5 replies
customize creating related model in Select form component when using createOptionForm()
The thing is that I do not want to change Partner form data, but I would like to assign relationship on newly created Partner model. That is the reason I tried to use using() method. But that method is not available on Filament\Forms\Components\Actions\Action class.
5 replies
How to update form field from resource Edit page's method?
After some more debugging problem was the way I was updating the value. This is foreach loop that made everything working fine:
I think that has nothing to do with filament but rather how PHP works.
4 replies
How to update form field from resource Edit page's method?
Update: If I dump all the form data in
updateProductStock()
method I can see that I've changed the quantity, but in the form it is still the old value.
After foreach loop in my updateProductStock()
method I've added:
When my livewire component dispatches 'update-stock' event, my method updateProductStock()
is executed and modal pops up with dumped data. I can see that I've changed stock value, but it is not reflected in the form.4 replies