jrm2k6/cloudder

Laravel 5.4 Compatibility

Closed this issue · 16 comments

2 errors on update:

Warning: Ambiguous class resolution, "Cloudinary\Akamai" was found in both "vendor/cloudinary/cloudinary_php/src/Akamai.php" and "vendor/cloudinary/cloudinary_php/src/Cloudinary/Akamai.php", the first will be used.
> post-update-cmd: php artisan optimize                           
  [Symfony\Component\Debug\Exception\FatalThrowableError]              
  Call to undefined method Illuminate\Foundation\Application::share()  
  Script php artisan optimize handling the post-update-cmd event returned with error code 1

@azcoppen Thanks! Will try to get to this tonight and will push a 5.4 branch if it is alright with you? I haven't had time to update my projects

@azcoppen for the warning, could it be because you pull the cloudinary_php library in your composer.json? It will be included by default when requiring cloudder, so maybe that can help!

@jrm2k6 That would be fantastic chap, thank you! I forked it into a private repo. Can do a PR if you like.

The issue is Laravel 5.4 removes share() in the register() method of the service provider. You just need to change share() to singleton().

Edit: this might require more, as i'm getting "illegal offset type" with PHP7.1. Will need your update - will wait for it instead of using a fork as it's causing errors atm.

Edit: Also, am not requiring Cloudinary API in composer.

Also, another error i'm getting here:

Warning: Ambiguous class resolution, "Cloudinary\Akamai" was found in both "vendor/cloudinary/cloudinary_php/src/Akamai.php" and "vendor/cloudinary/cloudinary_php/src/Cloudinary/Akamai.php", the first will be used.

@jrm2k6 It's an incredibly useful package - thanks for your work. Only 1 more thing - any chance you could change the Facade name to something more uniform than Cloudder? Would be great to just use Cloudinary::upload()!

I am not sure I can change the name as I am not affiliated with Cloudinary in any way. Not sure I can use that name.

@azcoppen @nicodebin Just pushed a new branch, could you guys check and make sure it works? Works fine on my local.

@jrm2k6 works fine in Lumen 5.4, thanks! I've made a PR (#29) for an additional change that is also needed. Please be sure this works fine with Laravel 5.4

@nicodebin Just merged it, thanks for your PR. I will double check that maybe on my lunch break, and will merge/release if it works fine. It looks like it is backwards compatible so all good! Thanks for your patience. I still have most of my side projects running on Laravel 5.2. 🚒

@jrm2k6 cool thanks! Yeah, me too.. most of my projects are running in 5.2 too, and a very huge one in 4.2 😱

@jrm2k6 Testing later tonight - thanks so much for the speed you responded to the issue with!

@azcoppen let me know when it is confirmed, will try to release asap.

@jrm2k6 Yep, looks great!

  - Removing jrm2k6/cloudder (dev-master 534cd8c)
  - Installing jrm2k6/cloudder (dev-master 64f4615) Downloading: 100% Extracting archive