mirror of
https://github.com/PhyreApps/PhyrePanel.git
synced 2024-11-22 07:30:25 +00:00
Update FileItem.php
This commit is contained in:
parent
207148a6a4
commit
f2750e7f91
1 changed files with 5 additions and 6 deletions
|
@ -13,7 +13,7 @@ class FileItem extends Model
|
||||||
{
|
{
|
||||||
use Sushi;
|
use Sushi;
|
||||||
|
|
||||||
protected static string $disk;
|
protected static string $rootPath;
|
||||||
|
|
||||||
protected static string $path;
|
protected static string $path;
|
||||||
|
|
||||||
|
@ -24,9 +24,9 @@ class FileItem extends Model
|
||||||
'type' => 'string',
|
'type' => 'string',
|
||||||
];
|
];
|
||||||
|
|
||||||
public static function queryForDiskAndPath(string $disk = 'public', string $path = ''): Builder
|
public static function queryForDiskAndPath(string $rootPath = 'public', string $path = ''): Builder
|
||||||
{
|
{
|
||||||
static::$disk = $disk;
|
static::$rootPath = $rootPath;
|
||||||
static::$path = $path;
|
static::$path = $path;
|
||||||
|
|
||||||
return static::query();
|
return static::query();
|
||||||
|
@ -37,7 +37,7 @@ class FileItem extends Model
|
||||||
return Storage::build([
|
return Storage::build([
|
||||||
'driver' => 'local',
|
'driver' => 'local',
|
||||||
'throw' => false,
|
'throw' => false,
|
||||||
'root' => static::$disk,
|
'root' => static::$rootPath,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -105,8 +105,7 @@ class FileItem extends Model
|
||||||
'size' => $storage->size($file),
|
'size' => $storage->size($file),
|
||||||
'type' => $storage->mimeType($file) ?: 'File',
|
'type' => $storage->mimeType($file) ?: 'File',
|
||||||
'path' => $file,
|
'path' => $file,
|
||||||
]
|
])
|
||||||
)
|
|
||||||
)->toArray();
|
)->toArray();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue