check() and $this->ajax(); } /** * Get the validation rules that apply to the request. */ public function rules(): array { return [ 'upload' => 'required|image|mimes:jpeg,png,jpg|max:2048', ]; } }