“Laravel Custom ada aturan” Kode Jawaban

Laravel Custom ada aturan

Validator::make($data, [
    'email' => [
        'required',
        Rule::exists('staff')->where(function ($query) {
            return $query->where('account_id', 1);
        }),
    ],
]);
Lokesh003

aturan :: ada dengan pesan khusus 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);
Kind Koala

Jawaban yang mirip dengan “Laravel Custom ada aturan”

Pertanyaan yang mirip dengan “Laravel Custom ada aturan”

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya