I would like to use FormRequest validation in which allow request fields only in rules() return array keys.
In the below code, I would like to allow request fields only 'os', 'number', 'version'. If request include the other field , return error response.
How can I modify the code ?
public function rules()
{
return [
'os' => [
'required',
\Rule::in(['android', 'ios']),
],
'number' => 'required|integer',
'version' => ['required', 'http://regex:/^\d+.\d+.\d+$/'],
];
}
from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2mGHaOd
via IFTTT
Aucun commentaire:
Enregistrer un commentaire