当前位置: 首页>>代码示例>>PHP>>正文


PHP Request::only方法代码示例

本文整理汇总了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);
 }
开发者ID:shegun-babs,项目名称:dakrush,代码行数:9,代码来源:OrderMailer.php

示例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];
     }
 }
开发者ID:nstojanovickg,项目名称:diplomski,代码行数:21,代码来源:TranslationRequest.php

示例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];
 }
开发者ID:nstojanovickg,项目名称:diplomski,代码行数:11,代码来源:CourseRequest.php

示例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];
 }
开发者ID:nstojanovickg,项目名称:diplomski,代码行数:11,代码来源:SubjectRequest.php

示例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'];
 }
开发者ID:nstojanovickg,项目名称:diplomski,代码行数:11,代码来源:SchoolYearRequest.php

示例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];
 }
开发者ID:nstojanovickg,项目名称:diplomski,代码行数:11,代码来源:AdminUserRequest.php


注:本文中的App\Http\Requests\Request::only方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。