Php laravel急切加载,并带有;加上;

Php laravel急切加载,并带有;加上;,php,laravel,Php,Laravel,我就是这样做的: Class 'place' not found 类本身就在那里,但只有在调用get()或find()方法时才会发生这种情况 有什么线索吗?像这样更改它,因为您需要提到名称空间和模型, 在两个函数“App\Place”中 $data['places'] = Place::with('children', 'parent')->get(); 这样更改它,因为您需要提到名称空间和模型, 在两个函数“App\Place”中 $data['places'] =

我就是这样做的:

Class 'place' not found
类本身就在那里,但只有在调用
get()
find()
方法时才会发生这种情况
有什么线索吗?

像这样更改它,因为您需要提到名称空间和模型, 在两个函数“App\Place”中

    $data['places'] = Place::with('children', 'parent')->get();

这样更改它,因为您需要提到名称空间和模型, 在两个函数“App\Place”中

    $data['places'] = Place::with('children', 'parent')->get();

如果您的关系不正确,请使用
App\Place
注意
App
和大写字母
p

public function parent()
{
   return $this->belongsTo('App\Place', 'parent_id');
}

Place::with(['children', 'parent'])->get();
OR
Place::with('children')->with('parent')->get();

如果您的关系不正确,请使用
App\Place
注意
App
和大写字母
p

public function parent()
{
   return $this->belongsTo('App\Place', 'parent_id');
}

Place::with(['children', 'parent'])->get();
OR
Place::with('children')->with('parent')->get();

Place::with(['children','parent'])->get();像这样更改它尝试像这样“Place::with(['children','parent'])->get();”仍然是相同的错误检查我的答案我已经更新了模型代码alsoPlace::get()是否有错误?Place::with(['children','parent'])->get();像这样更改它尝试像这样“Place::with(['children',parent'])->get();”仍然是相同的错误检查我的答案我已经更新了模型代码alsoPlace::get()是否有错误?