本文整理汇总了PHP中App\Http\Requests\Request::only方法的典型用法代码示例。如果您正苦于以下问题:PHP Request::only方法的具体用法?PHP Request::only怎么用?PHP Request::only使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类App\Http\Requests\Request
的用法示例。
在下文中一共展示了Request::only方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: mailOrder
public function mailOrder(Request $request)
{
$view = 'emails.order';
$subject = 'New Order Receipt';
$data = $request->only('product_name', 'message_text', 'email', 'phone');
$data['title'] = "New Order Email";
$user = (object) ['email' => 'info@dakrush-ent.com'];
return $this->sendTo($user, $subject, $view, $data);
}
示例2: rules
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
$arr = Request::only('Id', 'CatalogId', 'Keyword');
$keyword = $arr['Keyword'];
$catalog_id = $arr['CatalogId'];
$id = $arr['Id'];
if ($id) {
if ($this->checkKeyword($id, $catalog_id, $keyword)) {
return [];
} else {
return ['CatalogId' => 'required', 'Keyword' => 'required|unique:translation_keyword,keyword,NULL,id,catalog_id,' . $catalog_id];
}
} else {
return ['CatalogId' => 'required', 'Keyword' => 'required|unique:translation_keyword,keyword,NULL,id,catalog_id,' . $catalog_id];
}
}
示例3: rules
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
$id_arr = Request::only('Id');
$id = $id_arr['Id'];
return ['Name' => 'required|max:100|unique:course,name,' . $id];
}
示例4: rules
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
$id_arr = Request::only('Id');
$id = $id_arr['Id'];
return ['Name' => 'required|max:100|unique:subject,name,' . $id, 'Code' => 'required|max:10|unique:subject,code,' . $id];
}
示例5: rules
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
$id_arr = Request::only('Id');
$id = $id_arr['Id'];
return ['Year' => 'required|integer|max:' . date('Y') . '|unique:school_year,year,' . $id, 'DateStart' => 'date', 'DateEnd' => 'date', 'Description' => 'max:255'];
}
示例6: rules
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
$id_arr = Request::only('Id');
$id = $id_arr['Id'];
return ['Name' => 'required|max:100', 'Login' => 'required|max:32|unique:admin_user,login,' . $id, 'Email' => 'required|max:50|email|unique:admin_user,email,' . $id];
}