0

I mean is there anything like this?

User::where(['id' => $id, 'role' => 'Teacher'])->first()->delete();

Though I used this

User::where(['id' => $id, 'role' => 'Teacher'])->delete();

So just want an idea about it

STA
  • 30,729
  • 8
  • 45
  • 59
  • 1
    In this particular case, they'll do essentially the same thing, unless there are multiple users with that ID. (That'd be unusual; id is typically unique.) Do note that the `first()` approach will fire Eloquent observers; the second will not. – ceejayoz Jan 15 '21 at 15:10
  • Does this answer your question? [laravel Eloquent ORM delete() method](https://stackoverflow.com/questions/45458074/laravel-eloquent-orm-delete-method) – STA Jan 15 '21 at 15:13

0 Answers0