relationship with trashed
When using relationship() how do we handle loading trashed items into the field?
excample:
12 Replies
If I'm reading this right, would this depend on how you generate
$allTeams
?Ahh no, that makes no difference. It was then from being a standard non-relationship select
Updated, it's the relationship which applies withoutTrashed by default
Did you try
->withTrashed()->get()...
?Can't use ->get() in the builder. But I tried ->withTrashed() on the query->select i.e.
Do you still get a result here or some error? ^
Nothing, it just doesn't apply
Ok... Not sure but I think using
->select()
messes with the available columns in the query... so you might have to do the equivalent of withTrashed()
manually, by checking the deleted_at
columnOk thanks! I'll have a play a bit more
Thanks Guys, so ->withTrashed() worked but my CONCAT was only working when custom_field had a value π
Oh, cool! Did you modify the DB::raw() in any way? (just curious)
Yep, I chucked an IFNULL in so:
what about this?
Ohhhh Leandro!
That's mucho better. I forgot about option label