Description
Class Address extends SoftDeletes() {
public function addressable()
{
return $this->morphTo();
}
public function scopeSpace($query) {
return $query->where('addressable_type' ,'spaces');
}
}
Address::space()->has('addressable');
Result in "
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'self_16c3ee36946631a2bc5bd5c263214040.deleted_at' in 'where clause' (SQL: select * from address
where addressable_type
= spaces and exists (select * from address
as self_16c3ee36946631a2bc5bd5c263214040
where self_16c3ee36946631a2bc5bd5c263214040
.id
= self_16c3ee36946631a2bc5bd5c263214040
.addressable_id
and self_16c3ee36946631a2bc5bd5c263214040
.deleted_at
is null) and self_16c3ee36946631a2bc5bd5c263214040
.deleted_at
is null)
"
Where the last self_16c3ee36946631a2bc5bd5c263214040
.deleted_at
is null should have been address
.deleted_at
is null