1 | <?php |
||
2 | |||
3 | namespace Jobtech\LaravelChunky\Support; |
||
4 | |||
5 | use Jobtech\LaravelChunky\Events\MergeAdded; |
||
6 | |||
7 | class MergeFilesystem extends Filesystem |
||
8 | { |
||
9 | /** |
||
10 | * Write the origin stream into destination. |
||
11 | * |
||
12 | * @param string $destination |
||
13 | * @param resource|null $origin |
||
14 | * @param array $options |
||
15 | * |
||
16 | * @throws \Illuminate\Contracts\Filesystem\FileExistsException |
||
17 | * |
||
18 | * @return string |
||
19 | */ |
||
20 | public function store(string $destination, $origin, $options = []): string |
||
21 | { |
||
22 | $destination = $this->path($destination); |
||
23 | |||
24 | if ($this->filesystem()->disk($this->disk)->writeStream($destination, $origin, $options)) { |
||
25 | event(new MergeAdded($destination)); |
||
0 ignored issues
–
show
Bug
introduced
by
![]() |
|||
26 | |||
27 | return $destination; |
||
28 | } |
||
29 | |||
30 | return false; |
||
0 ignored issues
–
show
|
|||
31 | } |
||
32 | } |
||
33 |