I have the following driver:
public function store(HolRegRequest $request, RecHoliday $reghol)
{
$reghol->save();
if ($request->has('ajax_submit')) {
$response = ['message' => trans('messages.holext') . ' ' .
trans('messages.added'), 'status' => 'success'];
return response()->json($response, 200, array('Access-Controll-Allow-
Origin' => '*'));
}
return redirect()->back()->withSuccess(trans('messages.holext') . ' ' .
trans('messages.added'));
} I would like one of the two things to happen: when submit from the view, the serial field will have a random code again, since when submitting, it is saved in bd and the form is left blank or that when doing submit redirects me to the homepage