CodeSleeve / laravel-stapler

Stapler-based file upload package for the Laravel framework.
MIT License
556 stars 109 forks source link

Laravel 5.4 #118

Open WaterSpout opened 7 years ago

WaterSpout commented 7 years ago

Please, add Laravel 5.4 support I found one error to vendor/codesleeve/laravel-stapler/src/Providers/ServiceProvider.php file on 58 line, need will remove second param to closure function

Patroklo commented 7 years ago

Hi! Add this to your L5ServiceProvider. Well... it's better to make your own Provider extending the L5. But you get the idea.

EDIT: This exception appears in my installation only in the php artisan commands given that the problem it's in a command.

use Codesleeve\LaravelStapler\Services\ImageRefreshService;

......
    /**
     * Register the image refresh service with the container.
     */
    protected function registerImageRefreshService()
    {
        $this->app->singleton('ImageRefreshService', function ($app)
        {
            return new ImageRefreshService($app);
        });
    }

This should do the trick. The only change from the original code it's that I have deleted a parameter in the return new ImageRefreshService($app); But I don't know if it would be ok to send the changes as a pull request here.