Skip to content

Method Illuminate\Database\Eloquent\Collection::delete does not exist. #23985

Answered by bonzai
yaquawa asked this question in General
Discussion options

You must be logged in to vote

Just use ->each():

User::where('in_black_list', true)->get()->each->delete();

https://laravel.com/docs/5.6/collections#higher-order-messages

Replies: 5 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by GrahamCampbell
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
5 participants
Converted from issue

This discussion was converted from issue #23985 on June 26, 2020 07:33.