如何选择没有参数的Eloquent模型

时间:2016-06-16 13:38:43

标签: eloquent laravel-5.2 laravel-query-builder

我不知道他们的论点是什么?是正确的用语。我希望得到一个没有所有内容的模型,然后再添加selectswheres

$query = Pic::;

if($cat) $query->where('cat',$cat);
if($year) $query->where('jahrprod',$year);

$query->get();

Pic::Pic无法正常工作。只有DB::table('pics')可以,但似乎没有返回集合。

1 个答案:

答案 0 :(得分:1)

使用<div class="explain_container"> <div class="explain_text"> Text that's longer should extend the height of the box. Text that's longer should extend the height of the box. Text that's longer should extend the height of the box. Text that's longer should extend the height of the box. Text that's longer should extend the height of the box. Text that's longer should extend the height of the box. Text that's longer should extend the height of the box. Text that's longer should extend the height of the box. Text that's longer should extend the height of the box. Text that's longer should extend the height of the box. Text that's longer should extend the height of the box. Text that's longer should extend the height of the box. Text that's longer should extend the height of the box. Text that's longer should extend the height of the box. Text that's longer should extend the height of the box. Text that's longer should extend the height of the box. Text that's longer should extend the height of the box. Text that's longer should extend the height of the box. Text that's longer should extend the height of the box. Text that's longer should extend the height of the box. </div> </div>

Model::query();