Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Lokedi's avatar

Delete what is selected

d

0 likes
1 reply
Sergiu17's avatar
Sergiu17
Best Answer
Level 60

You need a function which takes an array, nothing special

public function destroyAll(array $ids)
{
	Model::whereIn('id', $ids)->delete();
}

Please or to participate in this conversation.