Support the ongoing development of Laravel.io →
Security Database Eloquent
Last updated 2 years ago.
0

If it's ver 4.2, then in case you don't use SoftDeletingTrait in your model, you call forceDelete method of the Eloquent\Builder, which runs delete on the query. In your case the query has no constraints, so it deletes all the rows.

Not sure why you get the 1st query though.

Last updated 2 years ago.
0

I'm not using SoftDeletingTrait in my model, i'll stick to delete() method i was just asking if this was a bug on Laravel or something.

1st query is because:

$deletetodo = Todo::find($id);
Last updated 2 years ago.
0

Obviously... I'm tired! I saw there DELETE not SELECT

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

eladio19 eladio19 Joined 11 Sep 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.