Available Validation Rules: Specifying A Custom Column Name

'state' => 'exists:states,abbreviation'
'email' => 'exists:connection.staff,email'
Use Illuminate\Validation\Rule;

Validator::make($data, [
    'email' => [
        'required',
        Rule::exists('staff')->where(function ($query) {
            $query->where('account_id', 1);
        }),
    ],
]);
Use Illuminate\Validation\Rule;

Validator::make($data, [
    'zones' => [
        'required',
        Rule::in(['first-zone', 'second-zone']),
    ],
]);
'video' => 'mimetypes:video/avi,video/mpeg,video/quicktime'
  • File.
  • Filled.
  • Gt:field.
  • Gte:field.
  • Image.
  • In:foo,bar,...
  • In_array:anotherfield.*.
  • Integer.
  • Ip.
  • Ipv4.
  • Ipv6.
  • Json.
  • Lt:field.
  • Lte:field.
  • Max:value.
  • Mimetypes:text/plain,...
  • Mimes:foo,bar,...

Available Validation Rules: Specifying A Custom Column Name — Structure map

Clickable & Draggable!

Available Validation Rules: Specifying A Custom Column Name — Related pages: