Answer the question
In order to leave comments, you need to log in
How to check only if the parameter is present?
There is a code
$validator = Validator::make( $this -> request, array(
'fio' => 'required',
'city' => 'required',
'phone' => 'required',
'delivery_id' => 'required|integer|exists:deliveries,id',
'payment_id' => 'required|integer|exists:payments,id',
'warehouse' => 'required'
)
);
if ($validator->fails())
return response()->json($validator->messages(), env('AJAX_ERROR') );
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question