Answers for "laravel request validation"

PHP
6

laravel image validation

'image' => 'required|image|mimes:jpeg,png,jpg,gif,svg|max:2048',
Posted by: Guest on May-30-2020
3

email validation in laravel

'email' => 'required|email|unique:users,email',
//@sujay
Posted by: Guest on October-09-2020
8

if any error in blade laravel

@if ($errors->any())
     @foreach ($errors->all() as $error)
         <div>{{$error}}</div>
     @endforeach
 @endif
Posted by: Guest on November-01-2020
1

php artisan make:request

php artisan make:request User\CreateUserRequest
Posted by: Guest on November-26-2020
7

laravel validation example

//import		
		use Illuminate\Support\Facades\Validator;
	
		// single var check
        $validator = Validator::make(['data' => $value],
            ['data' => 'string|min:1|max:10']
        );
        if ($validator->fails()) {
            // your code
        }

        // array check
        $validator = Validator::make(['data' => $array],
            ['email' => 'string|min:1|max:10'],
            ['username' => 'string|min:1|max:10'],
            ['password' => 'string|min:1|max:10'],
            ['...' => '...']
        );

        if ($validator->fails()) {
            // your code
        }
Posted by: Guest on April-17-2020

Code answers related to "laravel request validation"

Browse Popular Code Answers by Language