Sep 19, 2017
0
Level 6
Soft deleting works weird on server
Hello everyone! i'm using soft deletes for my models, and in some cases i'm quering deleted models via relations like this
public function team()
{
return $this->belongsTo(Team::class)->withTrashed();
}
The problem is that on my local env(laravel homestead) everything is fine but this relation returns null on hosting.
when i try to debug sql queries local version looks like this
select * from `teams` where `teams`.`id` in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
server version looks like this
select * from `teams` where `teams`.`id` in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) and `teams`.`deleted_at` is null
Please or to participate in this conversation.