Lionking-Dev
Lionking-Dev
FFilament
Created by ChesterS on 10/13/2023 in #❓┊help
Pass arguments to `DeleteAction` in Livewire component
😀
29 replies
FFilament
Created by ChesterS on 10/13/2023 in #❓┊help
Pass arguments to `DeleteAction` in Livewire component
and public function deleteMessage($messageId): Action { $this->selectedMessageId = $messageId; return DeleteAction::make('deleteMessage') ->confirm('Are you sure you want to delete this message?') ->onSuccess(function () { // Perform deletion logic here $message = Message::find($this->selectedMessageId); $message->delete(); // Show success notification or perform any other actions $this->alert('success', 'Message deleted successfully!'); }); }
29 replies
FFilament
Created by ChesterS on 10/13/2023 in #❓┊help
Pass arguments to `DeleteAction` in Livewire component
Define a public property in your component to store the selected message ID
29 replies
FFilament
Created by ChesterS on 10/13/2023 in #❓┊help
Pass arguments to `DeleteAction` in Livewire component
public $selectedMessageId;
29 replies
FFilament
Created by ChesterS on 10/13/2023 in #❓┊help
Pass arguments to `DeleteAction` in Livewire component
just second
29 replies
FFilament
Created by ChesterS on 10/13/2023 in #❓┊help
Pass arguments to `DeleteAction` in Livewire component
I hope this helps!
29 replies
FFilament
Created by ChesterS on 10/13/2023 in #❓┊help
Pass arguments to `DeleteAction` in Livewire component
html <!-- Template --> @foreach($this->messages as $message) <button wire:click="deleteMessage({{ $message->id }})">Delete</button> @endforeach
29 replies
FFilament
Created by ChesterS on 10/13/2023 in #❓┊help
Pass arguments to `DeleteAction` in Livewire component
php // MyComponent.php public function deleteMessage($messageId): Action { $message = Message::find($messageId); return DeleteAction::make('deleteMessage') ->record($message); }
29 replies
FFilament
Created by ChesterS on 10/13/2023 in #❓┊help
Pass arguments to `DeleteAction` in Livewire component
One possible slution is to modify your code as folows
29 replies
FFilament
Created by ChesterS on 10/13/2023 in #❓┊help
Pass arguments to `DeleteAction` in Livewire component
yeah
29 replies
FFilament
Created by ChesterS on 10/13/2023 in #❓┊help
Pass arguments to `DeleteAction` in Livewire component
Unfortunately, this approach won't work as you cannot directly pass arguments to a DeleteAction without overring the action method.
29 replies
FFilament
Created by ChesterS on 10/13/2023 in #❓┊help
Pass arguments to `DeleteAction` in Livewire component
Based on the code you provided, it appears that you're trying to call the deleteMessage() method and pass the $message->id as an argument within a loop.
29 replies
FFilament
Created by ChesterS on 10/13/2023 in #❓┊help
Pass arguments to `DeleteAction` in Livewire component
right?
29 replies
FFilament
Created by ChesterS on 10/13/2023 in #❓┊help
Pass arguments to `DeleteAction` in Livewire component
It seems like you are trying to add a DeleteAction to a component in Filament and pass arguments to it without overriding the action method.
29 replies
FFilament
Created by ChesterS on 10/13/2023 in #❓┊help
Pass arguments to `DeleteAction` in Livewire component
hello @ChesterS
29 replies
FFilament
Created by Charly / Toufloux on 10/6/2023 in #❓┊help
.avif images not showing in the 'form' part, but good on the website and the 'table' part
good
36 replies
FFilament
Created by Charly / Toufloux on 10/6/2023 in #❓┊help
.avif images not showing in the 'form' part, but good on the website and the 'table' part
thanks
36 replies
FFilament
Created by Charly / Toufloux on 10/6/2023 in #❓┊help
.avif images not showing in the 'form' part, but good on the website and the 'table' part
see you tomorrow
36 replies
FFilament
Created by Charly / Toufloux on 10/6/2023 in #❓┊help
.avif images not showing in the 'form' part, but good on the website and the 'table' part
however thank you for your effort
36 replies
FFilament
Created by Charly / Toufloux on 10/6/2023 in #❓┊help
.avif images not showing in the 'form' part, but good on the website and the 'table' part
😀
36 replies