Date: 2021-08-09 14:20:00, Hit: 541

이미지파일 유효성검사

Controller

public function solution(Request $request)
{
    $request->validate([
        'image' => 'required|image|mimes:jpg,png,jpeg,gif,svg|max:2048|dimensions:min_width=100,min_height=100,max_width=1000,max_height=1000',
    ]);
}

Blade

@if(count($errors) > 0)
    @foreach($errors->all() as $error)
        <div class="alert alert-danger">{{ $error }}</div>
    @endforeach
@endif
Edit Delete
License by Moony