1
我有2个表项和naws。 随着方法上的雄辩过滤器
Item::where('items.item_type' , '=' , $pagetype)->get();
我检索对象完美的,但现在我婉吨至在NAWS表上区域过滤。 我如何实现这一目标?
型号编号:
namespace App;
use Illuminate\Database\Eloquent\Model;
class Item extends Model
{
protected $table = 'items';
public function naw()
{
return $this->hasOne('App\Naw');
}
}