我正在尝试创建用于验证的laravel自定义消息.这是我到目前为止所尝试的:
原文链接:https://www.f2er.com/laravel/135744.html$messages = [ 'required' => 'Harap bagian :attribute di isi.','unique' => ':attribute sudah digunakan',]; $validator = Validator::make($request->all(),[ 'username' => array('required','unique:Userlogin,username'),'password' => 'required','email' => array('required',email'),$messages ]); if ($validator->fails()) { return redirect('/') ->withErrors($validator) // send back all errors to the login form ->withInput(); }else{ return redirect('/')->with('status','Kami sudah mengirimkan email,silahkan di konfirmasi'); }