How can I get the ID from the request, if is a new register, I want it to be null or 0
I need this to do custons validations, one validation for create and another for update
that is my Request
class PortifolioRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'nome' => 'required|max:255',
'url' => 'required',
];
}
public function messages()
{
return [
'nome.required' => 'O nome é obrigatório',
'nome.max' => 'O tamanho máximo para nome é de 255 caracteres',
'url.required' => 'A URL é obrigatória',
];
}
}
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire