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


PHP Request::has方法代码示例

本文整理汇总了PHP中App\Http\Requests\Request::has方法的典型用法代码示例。如果您正苦于以下问题:PHP Request::has方法的具体用法?PHP Request::has怎么用?PHP Request::has使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在App\Http\Requests\Request的用法示例。


在下文中一共展示了Request::has方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: rules

 /**
  * Get the validation rules that apply to the request.
  *
  * @return array
  */
 public function rules()
 {
     if (Request::has('data')) {
         return ['data' => 'required'];
     }
     return ['judul_berita' => 'required', 'kategori_berita' => 'required', 'isi' => 'required', 'foto' => 'required'];
 }
开发者ID:brutalcrozt,项目名称:SI-Sekolah-L5,代码行数:12,代码来源:BeritaRequest.php

示例2: rules

 /**
  * Get the validation rules that apply to the request.
  *
  * @return array
  */
 public function rules()
 {
     if (Request::has('DentreI')) {
         return ['nombre' => 'required', 'num_telefono' => 'required|numeric', 'Fcalle' => 'required', 'Fcolonia' => 'required', 'grupoGiro' => 'required', 'Fciudad' => 'required', 'Fmunicipio' => 'required', 'Festado' => 'required', 'Fcp' => 'required|size:5', 'Fnumero' => 'required|integer'];
     } else {
         return ['nombre' => 'required', 'num_telefono' => 'required|numeric', 'Fcalle' => 'required', 'Fcolonia' => 'required', 'grupoGiro' => 'required', 'Fciudad' => 'required', 'Fmunicipio' => 'required', 'Festado' => 'required', 'Fcp' => 'required|size:5', 'Fnumero' => 'required|integer', 'en_calle' => 'required', 'en_colonia' => 'required', 'en_ciudad' => 'required', 'en_municipio' => 'required', 'en_estado' => 'required', 'en_cp' => 'required|size:5', 'en_numero' => 'required|integer'];
     }
 }
开发者ID:AlbertMed,项目名称:ceseh,代码行数:13,代码来源:CreateUserRequest.php

示例3: rules

 /**
  * Get the validation rules that apply to the request.
  *
  * @return array
  */
 public function rules()
 {
     if (Request::hasFile('file')) {
         return ['data' => 'required', 'file' => 'required'];
     }
     if (Request::has('id_download')) {
         return ['judul_file' => 'required'];
     }
     return ['judul_file' => 'required', 'file' => 'required'];
 }
开发者ID:mhixv,项目名称:sim,代码行数:15,代码来源:UploadRequest.php

示例4: rules

 /**
  * Get the validation rules that apply to the request.
  *
  * @return array
  */
 public function rules()
 {
     if (Request::has('id_foto')) {
         $foto = 'image';
         return ['id_album' => 'required', 'foto' => $foto];
     }
     if (Request::has('data')) {
         $foto = 'required|image';
         return ['data' => 'required', 'file' => $foto];
     }
     return ['id_album' => 'required', 'foto' => 'required|image'];
 }
开发者ID:mhixv,项目名称:sim,代码行数:17,代码来源:FotoRequest.php

示例5: rules

 public function rules()
 {
     if (Request::has('recalculateShipping') || Request::has('orderId')) {
         return [];
     }
     $validation = ['emailAddress' => 'required|email', 'fullName' => 'required', 'shippingaddressId' => 'required_without_all:shippingaddress1,shippingcity,shippingcountry', 'shippingaddress1' => 'required_without:shippingaddressId', 'shippingcity' => 'required_without:shippingaddressId', 'shippingcountryId' => 'required_without:shippingaddressId'];
     if (!Request::has('billingAddressSameAsShipping')) {
         $validation['billingaddressId'] = 'required_without_all:billingaddress1,billingcity,billingcountry';
         $validation['billingaddress1'] = 'required_without:billingaddressId';
         $validation['billingcity'] = 'required_without:billingaddressId';
         $validation['billingcountryId'] = 'required_without:billingaddressId';
     }
     return $validation;
 }
开发者ID:alistairshaw,项目名称:vendirun-plugin,代码行数:14,代码来源:OrderRequest.php


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