verumconsilium / laravel-browsershot

Browsershot wrapper for Laravel 5
MIT License
110 stars 19 forks source link

using storeAs throwing error after recent update #4

Closed artin closed 6 years ago

artin commented 6 years ago

We updated packages using <composer update) and browsershot showing error if we use storeAs option ....

Undefined index: screenshot-filename.jpg

from this file and section : /vendor/league/flysystem/src/Adapter/Local.php line 350: $success = chmod($location, $this->permissionMap[$type][$visibility]);

this is our test code which was working before this update:

Screenshot::loadUrl($url)
    ->windowSize(1024, 850)
         ->useJPG()
    ->storeAs('public/',"screenshot-filename.jpg");

it actually taking screen shot but saving in another name and as png !

this is the ourput file: ROCZJfQGkiXoeNrp7iA9W9xg7mSGRzDqs70NITJW.png

artin commented 6 years ago

Update: I tried this on a clean Laravel 5.7 install and got the same result ... it seems there are issue with some recent laravel packages ...

nickels commented 6 years ago

Great package, unfortunately same issue here!

        "name": "laravel/framework",
        "version": "v5.7.8",

        "name": "verumconsilium/laravel-browsershot",
        "version": "v1.0.2",
nickels commented 6 years ago

https://github.com/verumconsilium/laravel-browsershot/pull/5

Should address the issue, not sure however if the putFileAs method works when the $filename is null.

verumconsilium commented 6 years ago

5 fixed the issue. Added tests and some changes to @nickels contribution

Thanks for the support