Closed bar00ng closed 10 months ago
I've faced this issue too. When calling $this->alert() or $this->confirm() function, you can set in the third parameter $options a data array, like this:
$this->confirm("Are you sure?", [
'onConfirmed' => "confirmed",
'data' => [
'post_id' => $postId
]
]);
Then, in the confirmed function handler:
public function confirmed($data)
{
$postId = Arr::get($data, 'data.post_id', null);
// other code
}
wow this is so useful bro!! thank you so much!!
Hey I'm having trouble to passing an ID of my model to the onConfirmed function. can you guide me?? If u want i can provide you my code.