【发布时间】:2017-10-20 02:04:58
【问题描述】:
例如,在我的 Laravel 代码中,我有:
$query = User::select('ID', 'Name')
->with(['agent' => function ($query) {
$query->select('MemberID', 'dbPhoto');
}])->get();
如果没有类型提示 $query,我的 ide 会发出未知方法 select() 的警告。
如果我不想输入提示 $query,因为它可能接受不同的类型(但在这种情况下不是),我该怎么做?
【问题讨论】: