all(), [ 'name' => 'required', ]); if ($validator->fails()) { return redirect('products/create') ->withErrors($validator); } Product::create($validator->validated()); return 'Success'; } }