After updating to Laravel 9.14 with PHP 8.1.4 then streaming has broke that was based on this answer https://stackoverflow.com/a/52598361/6825499.
I can see that it is because of a
Call to undefined method LeagueFlysystemAwsS3V3AwsS3V3Adapter::getClient()
So it seems to have been removed in the newest version from league/flysystem-aws-s3-v3 (3.0.13)
I did find a reference to this SO post which tries to explain there is a workaround now: Get S3Client from storage facade in Laravel 9
This is though too complex for me to understand.
Does anyone know what can be done?
2
Answers
After researching quite a bit I realized that the issue came down to updates described in Laravel document page about upgrading.
I ended up altering the code a bit where I use environment variables to fill out what was before provieded by the adapter in the code.
In the latest version of the flysystem,there is no longer access to the client via the adapter. Due to mentioned reason, the service has been broken.
For a fully working class then you can use below code for laravel version 9
You need to update the PHP version on your server to the latest one. It sounds like the server is still on the PHP 7.x version and that’s the issue.