getClientOriginalExtension(); if (in_array($fileExtension, $allowedExtensions)) { return true; } else { return false; } } /** * Get the validation error message. * * @return string */ public function message() { if ( URL::current() == Route::is('admin.advertise.store_advertisement') || URL::current() == Route::is('admin.advertise.update_advertisement') ) { return 'Only .jpg, .jpeg, .png, .svg and .gif file is allowed.'; } else { return 'Only .jpg, .jpeg and .png file is allowed.'; } } }