Karim Bakhsh
Karim Bakhsh
FFilament
Created by Karim Bakhsh on 5/21/2024 in #❓┊help
Previewing files in file Uploader
I have a created a custom view for updating a record which has the content of a record in it including a file uploader. Among the data that is passed to the view, there is an array called attachments which holds the path to some files related to that respective record. What I would like to do is, to view those files in file uploader, so I can remove them or reorder them. I have tried passing the attachments array to ->default() method of the file uploader, but it does not work. I ve explored the documentation, and searched on the internet, but found nothing useful. I wonder if someone can help me out to figure the solution out. File paths in attachments array looks like this subfolder/filename.jpeg. Files are in public folder, so they are publicly accessible.
2 replies
FFilament
Created by Karim Bakhsh on 6/22/2023 in #❓┊help
files not previewed when form is pre-filled with data
2 replies
FFilament
Created by Karim Bakhsh on 5/21/2023 in #❓┊help
control modal from blade file
I have a page where different types of users' information needs to be saved. There is only one action button that opens a modal containing a form that collects the users info, and save that into an array temporarily. as soon as the array has got an item, there is my custom view that renders the data along with two buttons (update, and delete). the delete function takes the index of the current item, and then removes the item from the array in case it is clicked.
<x-filament::button type="button" color="danger" wire:click="deleteItem({{ $index }})">
Delete
</x-filament::button>
<x-filament::button type="button" color="danger" wire:click="deleteItem({{ $index }})">
Delete
</x-filament::button>
Now the real questions comes here! here is the update button
<x-filament::button wire:click="openModal({{ $index }})">
Update
</x-filament::button>
<x-filament::button wire:click="openModal({{ $index }})">
Update
</x-filament::button>
I would like to have a modal to open when this button is clicked. The modal should contain a form with some pre-filled data passed to it. how can I implement the openModal function to open the modal and pass the needed data to it, so the modal can fill its form with the corresponding data. I am new to filament, so if I am doing it wrong, let me know about the correct way of doing it.
12 replies