1
我使用Laravel的基本WAMP服務器Laravel 4:值必須提供
我已經得到了錯誤Value must be provided.
這是控制器代碼:
public function edit($id)
{
$query = DB::table('submenus');
$content = Content::find($id);
$galleries = Gallery::where('parent_id', '<>', $content->parent_id)->lists('parent_id', 'id');
$contents = Content::where('parent_id', '<>', $content->parent_id)->lists('parent_id', 'id');
$this_parent = Submenu::where('id' , '=' , $content->parent_id)->first();
/*if (!empty($galleries))
{
$query->whereNotIn('id', $galleries);
}
if (!empty($contents))
{
$query->whereNotIn('id', $contents);
}*/
$submenus = $query->lists('name', 'id');
asort($submenus);
$submenus[null] = "Aucun";
$this->layout->content = View::make('contents.edit', array(
"content" => $content,
"submenus" => $submenus,
"contents" => $contents,
"galleries" => $galleries
));
}
和錯誤消息:
InvalidArgumentException
Value must be provided.
From:C:\ webroot \ okalli \ rest \ vendor \ laravel \ framework \ src \ Illumin吃\數據庫\查詢\ Builder.php
// and keep going. Otherwise, we'll require the operator to be passed in.
if (func_num_args() == 2)
{
list($value, $operator) = array($operator, '=');
}
elseif ($this->invalidOperatorAndValue($operator, $value))
{
throw new \InvalidArgumentException("Value must be provided.");
}
我真的不知道是什麼問題..