We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b96e670 commit 1706ea0Copy full SHA for 1706ea0
src/Media.php
@@ -4,6 +4,7 @@
4
namespace Plank\Mediable;
5
6
use Carbon\Carbon;
7
+use GuzzleHttp\Psr7\Utils;
8
use Illuminate\Contracts\Filesystem\Filesystem;
9
use Illuminate\Database\Eloquent\Builder;
10
use Illuminate\Database\Eloquent\Collection;
@@ -397,9 +398,11 @@ public function contents(): string
397
398
*/
399
public function stream()
400
{
- return \GuzzleHttp\Psr7\stream_for(
401
- $this->storage()->readStream($this->getDiskPath())
402
- );
+ $stream = $this->storage()->readStream($this->getDiskPath());
+ if (method_exists(Utils::class, 'streamFor')) {
403
+ return Utils::streamFor($stream);
404
+ }
405
+ return \GuzzleHttp\Psr7\stream_for($stream);
406
}
407
408
/**
0 commit comments