Use mime type to specify the extension of the image in laravel.
A full listing of MIME types and their corresponding extensions may be found at the following location:
https://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types
I wonder if this match??
custom request
ImageRequest.php
namespace App\Http\Requests; use Illuminate\Foundation\Http\FormRequest; class ImageRequest extends FormRequest { /** * Determine if the user is authorized to make this request. * * @return bool */ public function authorize() { return false; } /** * Get the validation rules that apply to the request. * * @return array */ public function rules() { return [ 'image' => 'image|mimes:jpg,jpeg,gif,png', ]; } public function messages() { return [ 'image.required' => '画像以外のファイルが指定されています。画像ファイル(png/jpg/jpeg/gif)を指定して下さい', ]; } }