Answers for "laravel set validation message"

PHP
1

validation error message in laravel

@if ($errors->any())
    <div class="alert alert-danger">
        <ul>
            @foreach ($errors->all() as $error)
                <li>{{ $error }}</li>
            @endforeach
        </ul>
    </div>
@endif
Posted by: Guest on August-04-2021
0

Laravel validation custom message

$messsages = [
              '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 = [
              'email'=>'required|unique:content',
              'name'=>'required|min:3',
			];

$validator = Validator::make($request, $rules,$messsages);
Posted by: Guest on September-10-2021

Code answers related to "laravel set validation message"

Browse Popular Code Answers by Language