OneOffTech / laravel-tus-upload

A package for handling resumable file uploads in a Laravel application via the http://tus.io/ resumable file upload protocol.
https://oneofftech.xyz/open-source/
MIT License
50 stars 13 forks source link

Trait "OneOffTech\Uploaddy\HasUploads" not found #51

Closed fjahn closed 2 years ago

fjahn commented 2 years ago

When following the setup guide, I added the HasUploads trait to my User class. After that, I got this error on my page:

Symfony\Component\ErrorHandler\Error\FatalError Trait "OneOffTech\Uploaddy\HasUploads" not found

For testing, I changed the namespace of HasUploads from OneOffTech\Uploaddy to OneOffTech\TusUpload. This is the namespace that is defined for the other classes within the same folder. With that change, it works fine.

I do not know much about how the autoloading with composer works, but I doubt that this is how it's supposed to work. It his my fault, or is it laravel-tus-upload's fault? Can I fix this without having to edit HasUploads?

avvertix commented 2 years ago

Hi @fjahn thanks for spotting that error. We renamed the namespace some time ago and apparently the namespace on the trait was not properly refactored.

It his my fault, or is it laravel-tus-upload's fault?

it is on our side since the file is part of the library

Can I fix this without having to edit HasUploads?

If you want you can submit a pull request with the change so every other users of the library can benefit, otherwise I'll take of change it and create a release. In any case a new patch release is required and after the fix is included in the library you should run composer update to pull the new version with the fix.

fjahn commented 2 years ago

Thank you for the rapid response! Glad to hear this can be fixed easily. If you want, I can write a PR soon, but considering that this is a single line change, I doubt that I would actually save you time by doing that 😄

avvertix commented 2 years ago

ahaha sure, I'll let you know when a release is available

avvertix commented 2 years ago

Tag 0.10.1 pushed, should be available via a composer update shortly