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

I have even tried a hack of just setting the delete_ at field with:

date('Y-m-d H:i:s');

But still no luck. The row still appears when I get the data.

Last updated 2 years ago.
0

Do you have the relationships setup in the Model classes ?

Author hasMany books Book has one Author

http://laravel.com/docs/eloquent#relationships
Last updated 2 years ago.
0

Yep, the relationships are set up in the models.

Last updated 2 years ago.
0

I managed to get rid of the error, so delete works but it's not soft deleting, it's removing the entire row from the database.

Am I calling delete correctly?

Author::find($id)->delete();

I've also tried:

Author::destroy($id);
Last updated 2 years ago.
0

bump

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

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.