approached / laravel-image-optimizer

[deprecated] Image optimizer for laravel
MIT License
152 stars 33 forks source link

Options don't seem to taken into account #31

Open danjdewhurst opened 7 years ago

danjdewhurst commented 7 years ago

It seems like any options I provide in the published configuration file aren't being passed to the OptimizerFactory. I'm using v2.3 with Laravel 5.2.

approached commented 7 years ago

How do you use this package?

Like https://github.com/approached/laravel-image-optimizer/blob/master/tests/ConvertJPGTest.php#L26 ?

approached commented 7 years ago

Here would the config file loaded.... https://github.com/approached/laravel-image-optimizer/blob/master/src/ServiceProvider.php#L22

danjdewhurst commented 7 years ago

I was dd()ing the $options variable in \vendor\ps\image-optimizer\src\ImageOptimizer\OptimizerFactory.php, and it wasn't getting set. This was unless I removed the $this->app->singleton() wrapper from the approached/laravel-image-optimizer/blob/master/src/ServiceProvider.php construct, and it seemed to work fine again.

I'm not great with service providers, so I don't really understand what that $this->app->singleton() bit is for!

I apologise if I've brought up a non-issue.