Support the ongoing development of Laravel.io →
Database Eloquent

I was looking at the code in the delete method of the Model object in Model.php. The code eventually calls a delete on the database but the return value from that call is ignored and it is assumed to be successful. There is even a comment to that effect in the code:

    // Once the model has been deleted, we will fire off the deleted event so that
    // the developers may hook into post-delete operations. We will then return
    // a boolean true as the delete is presumably successful on the database.

Why does the code ignore the return code from the delete? Why assume that the delete was successful?

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

edsuna edsuna Joined 5 Mar 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.

© 2025 Laravel.io - All rights reserved.