CodeSleeve / laravel-stapler

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

Unable to refresh images #65

Closed hotmeteor closed 9 years ago

hotmeteor commented 9 years ago

Laravel 4 laravel-stapler v1.0.0

Trying to refresh, however i'm receiving two different errors and unable to perform a refresh.

Error 1, when trying to specify an attachment (php artisan stapler:refresh Artifact --attachments="image"):

 [ErrorException]                                                                                                                              
  Argument 2 passed to Codesleeve\LaravelStapler\Services\ImageRefreshService::refresh() must be of the type array, string given, called in /h  
  ome/forge/default/vendor/codesleeve/laravel-stapler/src/Codesleeve/LaravelStapler/Commands/RefreshCommand.php on line 56 and defined

Error 2, when trying without an attachment (php artisan stapler:refresh Skynet/Artifacts/Artifact) or (php artisan stapler:refresh Artifact):

  [Codesleeve\LaravelStapler\Exceptions\InvalidClassException]                        
  Invalid class: the Skynet/Artifacts/Artifact class is not currently using Stapler. 

My models are in subfolders.

Any ideas? Thanks.

hotmeteor commented 9 years ago

Error 1 is related to https://github.com/CodeSleeve/laravel-stapler/blob/master/src/Services/ImageRefreshService.php#L49, where it's expecting an array but having a string (from the command-line) passed in. The function itself looks to be expecting a string as well.

Update:

Error 2 was bad syntax, and the model should have been in quotes: php artisan stapler:refresh "Skynet\Artifacts\Artifact"

hotmeteor commented 9 years ago

This pull fixes that issue: https://github.com/CodeSleeve/laravel-stapler/pull/66

tabennett commented 9 years ago

I've merged this PR so this is on master now and will be in the next release.