本文整理汇总了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'];
}
示例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'];
}
}
示例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'];
}
示例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'];
}
示例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;
}