{
$this->checkPermission('image-create-all');
$this->validate($request, [
- 'file' => 'is_image'
+ 'file' => 'image'
]);
if (!$this->imageRepo->isValidType($type)) {
public function boot()
{
// Custom validation methods
- Validator::extend('is_image', function ($attribute, $value, $parameters, $validator) {
+ Validator::extend('image', function ($attribute, $value, $parameters, $validator) {
$imageMimes = ['image/png', 'image/bmp', 'image/gif', 'image/jpeg', 'image/jpg', 'image/tiff', 'image/webp'];
return in_array($value->getMimeType(), $imageMimes);
});
'email' => 'The :attribute must be a valid email address.',
'filled' => 'The :attribute field is required.',
'exists' => 'The selected :attribute is invalid.',
- 'image' => 'The :attribute must be an image.',
+ 'image' => 'The :attribute must be an image.',
'in' => 'The selected :attribute is invalid.',
'integer' => 'The :attribute must be an integer.',
'ip' => 'The :attribute must be a valid IP address.',