This commit is contained in:
Bozhidar 2024-05-13 19:57:25 +03:00
parent 081b67f1ef
commit 207148a6a4
2 changed files with 13 additions and 3 deletions

View file

@ -146,6 +146,17 @@ class ManageHostingSubscriptionFileManager extends ViewRecord implements HasTabl
->checkIfRecordIsSelectableUsing(fn (FileItem $record): bool => ! $record->isPreviousPath())
->headerActionsPosition(HeaderActionsPosition::Bottom)
->headerActions([
Action::make('home')
->label('Home')
->action(fn () => $this->path = '')
->icon('heroicon-o-home'),
Action::make('back')
->label('Back')
->action(fn () => $this->path = dirname($this->path))
->icon('heroicon-o-arrow-left'),
Action::make('create_folder')
->label('Create Folder')
->icon('heroicon-o-folder-plus')

View file

@ -96,15 +96,14 @@ class FileItem extends Model
'size' => null,
'type' => 'Folder',
'path' => $directory,
]
),
]),
...collect($storage->files(static::$path))
->sort()
->map(fn (string $file): array => [
'name' => Str::remove(self::$path.'/', $file),
'dateModified' => $storage->lastModified($file),
'size' => $storage->size($file),
'type' => $storage->mimeType($file) ?: null,
'type' => $storage->mimeType($file) ?: 'File',
'path' => $file,
]
)