【发布时间】:2013-08-26 08:00:26
【问题描述】:
我正在尝试获取具有嵌套继承并针对某些列进行过滤的表。而且找不到好办法。
我有桌子店女巫有很多地点(地点有一个城市)和很多行动
我想使用 Eloquent 一次性获取所有内容并过滤特定列。
这就是我过滤商店表的方式,但不知道如何过滤表位置和操作。
$this->shop->with('locations')->with('actions')->get(array('id','name','recommended','category_id'));
我需要这样的东西:
$this->shop
->with('locations',Location::with('city', City::get(array('id','name')))->get(array('id','name')))
->with('actions', Action::get(array('id','name')))->get(array('id','name')););
【问题讨论】: