Support the ongoing development of Laravel.io →
Database Eloquent Blade
Last updated 1 year ago.
0

Respectful bump.

I just want to be able to control what queries use the deleted_at column.

Last updated 1 year ago.
0

I'm thinking the answer may be to just disable the automatic soft-deleting and add a scope element to the model.

Last updated 1 year ago.
0

When you call the relationship as a function, it creates a new query builder. So you need to use get() or first() in order to use the results:

$car->owner()->withTrashed()->first()->name

See this section of the docs for more info: http://laravel.com/docs/eloquent#one-to-many

Last updated 1 year ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

neon5 neon5 Joined 21 Feb 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.