0
我使用的是软删除我的模特工作,并在某些情况下,我通过这样的withTrashed()不上服务器
public function team()
{
return $this->belongsTo(Team::class)->withTrashed();
}
问题关系查询删除模式是,在我的地方env(laravel homestead)一切都很好,但是这个关系在主机上返回null。
当我尝试调试SQL查询本地版本看起来像这样
select * from `teams` where `teams`.`id` in (?, ?, ?, ?, ?, ?, ?, ?, ?,
?, ?, ?, ?)
Server版本看起来像这样
select *
from `teams`
where `teams`.`id` in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
and `teams`.`deleted_at` is null
什么是“托管”?确保服务器上的代码实际上是你认为的。你有不同的配置文件吗? – Relequestual
“托管”是https://hostinguk.net/上的开发服务器,代码在本地和托管上是相同的。认为配置不是问题,因为我实际上有不同的数据库查询 –
在这种情况下,您需要与您的托管服务提供商交谈。不知道您的本地环境与托管环境有什么不同,任何人都不可能复制问题或提供解决方案。 – Relequestual