pionl / laravel-chunk-upload

The basic implementation for chunk upload with multiple providers support like jQuery-file-upload, pupload, DropZone and resumable.js
MIT License
604 stars 167 forks source link

Unresolvable dependency resolving #130

Open ackerchez opened 2 years ago

ackerchez commented 2 years ago

Hello.

I tried to use the controllers here to create a chucked upload. I am getting the following error

"Unresolvable dependency resolving [Parameter #0 [ $disk ]] in class Pion\Laravel\ChunkUpload\Storage\ChunkStorage"

It seems that when the FileReceiver is trying to initialize it calls the following method in ChunkStorage.php

public static function storage() { return app(self::class); }

That method is returning an instance of self but the constructor for that class requires two params:

public function __construct($disk, $config) { .... }

As a result, it seems there is an instance loading problem.

Q A
This Package Version 1.5
Laravel Framework Version 8.27
PHP version 8
pionl commented 2 years ago

Hi,

could you please check if the provider is auto-discovered? This seems like the service provider was not loaded.

I've tried Laravel 8 + PHP 8.0 (real upload) in example repo an it works :(

ackerchez commented 2 years ago

Thanks I will try. However, even when I try and manually get the provider to copy over the console prints out that there was nothing to copy in.

On Tue, Mar 22, 2022 at 8:03 PM Martin Kluska @.***> wrote:

Hi,

could you please check if the provider is auto-discovered? This seems like the service provider was not loaded.

I've tried Laravel 8 + PHP 8.0 (real upload) in example https://github.com/pionl/laravel-chunk-upload-example repo an it works :(

— Reply to this email directly, view it on GitHub https://github.com/pionl/laravel-chunk-upload/issues/130#issuecomment-1075456995, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHBIKCUU4NFQT6B64USWMDVBIDQPANCNFSM5RKQTXZQ . You are receiving this because you authored the thread.Message ID: @.***>

pionl commented 2 years ago

It should not copy anything, It seems that the Laravel has not auto-discovered the package for some reason - maybe you have disabled this functionality?

pionl commented 2 years ago

Have you found out the problem? Otherwise im gona close the issue

harrisonbudiman commented 2 years ago

Hi I have same issue? any idea how to solved it? image

harrisonbudiman commented 2 years ago

ok on my case you need to put the services provider on config/app then run php artisan cache:clear it solved it... image

pionl commented 2 years ago

Did do you disable auto discover feature in Laravel?

harrisonbudiman commented 2 years ago

hmm no...i am on laravel 8 and just using composer to install your script, anyway thank you so much

ytsirc0326 commented 2 years ago

ok on my case you need to put the services provider on config/app then run php artisan cache:clear it solved it... image

It works. Thanks!