image file validation in laravel code example
Example 1: laravel image validation
'image' => 'required|image|mimes:jpeg,png,jpg,gif,svg|max:2048',
Example 2: image validate in laravel validater
$this->validate($request, ['file' => 'image|mimes:jpeg,png,jpg,gif,svg|max:2048',]);
Example 3: laravel validation
use Illuminate\Validation\Rule;
Validator::make($data, [
'email' => [
'required',
Rule::unique('users')->ignore($user->id),
],
]);