2024-02-23 18:36:02 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Filesystems;
|
|
|
|
|
|
|
|
use DateTimeInterface;
|
|
|
|
use League\Flysystem\Filesystem;
|
|
|
|
use Spatie\FlysystemDropbox\DropboxAdapter;
|
|
|
|
|
|
|
|
class DropboxFilesystem extends Filesystem
|
|
|
|
{
|
2024-04-18 14:36:28 +00:00
|
|
|
public function __construct(private readonly DropboxAdapter $adapter)
|
2024-02-23 18:36:02 +00:00
|
|
|
{
|
|
|
|
parent::__construct($adapter, ['case_sensitive' => false]);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function temporaryUrl(string $path, ?DateTimeInterface $expiresAt = null, array $config = []): string
|
|
|
|
{
|
|
|
|
return $this->adapter->getUrl($path);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getAdapter(): DropboxAdapter
|
|
|
|
{
|
|
|
|
return $this->adapter;
|
|
|
|
}
|
|
|
|
}
|