I have been using notifications more and more in a project and one section requires that if say a task (which in this case is based as a notification) has been completed, I'd like to cycle through and delete all instances of the notifications across all of the collection of users it was initially sent out to.
At the moment, this is the part I am stuck on:
$notifications = DB::table('notifications')->where('type', $task->type)->where('data', $data)->get();
foreach($notifications as $n){
$n->delete();
}
$notifications does return me the correct record entries, so that's not a problem at all. But when I go to commit the delete() it tells me: Call to undefined method stdClass::delete().
Are there any suggestions? I'm willing to change things up as well, but am hoping this will be the best path to go for now and be able to locate a solution.
Thanks!
from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2IE9n4B
via IFTTT
Aucun commentaire:
Enregistrer un commentaire