laravel required if
"sale_price" => "required_if:list_type,==,selling"
laravel required if
"sale_price" => "required_if:list_type,==,selling"
laravel validation
/**
* Store a new blog post.
*
* @param Request $request
* @return Response
*/
public function store(Request $request)
{
$validatedData = $request->validate([
'title' => 'required|unique:posts|max:255',
'body' => 'required',
]);
// The blog post is valid...
}
rule::exists with custom message laravel
$messsages = array(
'email.required'=>'You cant leave Email field empty',
'name.required'=>'You cant leave name field empty',
'name.min'=>'The field has to be :min chars long',
);
$rules = array(
'email'=>'required|unique:content',
'name'=>'required|min:3',
);
$validator = Validator::make(Input::all(), $rules,$messsages);
validation required in laravel
Request()->validate([
'nik' => 'required',
'nama' => 'required',
'alamat' => 'required',
'notelp' => 'required',
'jk' => 'required',
'agama' => 'required',
'pekerjaan' => 'required',
'status' => 'required',
], [
'nik.required' => 'nik Wajib Diisi!',
'nama.required' => 'nama perolehan Wajib Diisi!',
'alamat.required' => 'alamat Wajib Diisi!',
'notelp.required' => 'notelp Wajib Diisi!',
'jk.required' => 'jk Wajib Diisi!',
'agama.required' => 'agama habis Wajib Diisi!',
'pekerjaan.required' => 'pekerjaan Wajib Diisi!',
'status.required' => 'status Wajib Diisi!',
]);
validation.required laravel
9
If it has worked for you before then you should check if you have messages defined in the app\lang\en\validation.php or by chance you have changed the locale of the app and have not defined the messages for it. There are many possibilities.
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us