тоже самое из модели нет: $unitStructure = $this->unitStructure->parent()->with('employees')->first(); $unitStructure->employees->where('chief', true);
Пишет: Trying to get property 'employees' of non-object
тоже самое из модели нет: $unitStructure = $this->unitStructure->parent()->with('employees')->first(); $unitStructure->employees->where('chief', true);
Пишет: Trying to get property 'employees' of non-object
почему так может быть?
в 1м случае коллекция, из контроллера объект. У вас не одно и тоже в этом коде
тоже самое из модели нет: $unitStructure = $this->unitStructure->parent()->with('employees')->first(); $unitStructure->employees->where('chief', true);
Пишет: Trying to get property 'employees' of non-object