Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
php-version: '8.3'
coverage: none

- name: Install composer dependencies
Expand Down
3 changes: 2 additions & 1 deletion src/Resources/LibraryItemResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ public static function form(Schema $schema): Schema
\Filament\Forms\Components\SpatieMediaLibraryFileUpload::make('files')
->label('File')
->visible(fn (callable $get) => $get('type') === 'file')
->required(fn (callable $get) => $get('type') === 'file'),
->required(fn (callable $get) => $get('type') === 'file')
->maxSize(512000), // 500MB

// Link form fields
\Filament\Forms\Components\TextInput::make('external_url')
Expand Down
23 changes: 22 additions & 1 deletion src/Resources/Pages/EditFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,33 @@ public function form(\Filament\Schemas\Schema $schema): \Filament\Schemas\Schema
->maxLength(255),

\Filament\Forms\Components\SpatieMediaLibraryFileUpload::make('files')
->label('File'),
->label('File')
->maxSize(512000), // 500MB

\Filament\Forms\Components\Textarea::make('link_description')
->label('Description')
->rows(3),

\Filament\Forms\Components\Select::make('tags')
->label('Tags')
->relationship('tags', 'name')
->multiple()
->searchable()
->preload()
->createOptionForm([
\Filament\Forms\Components\TextInput::make('name')
->required()
->maxLength(255),
])
->createOptionUsing(function (array $data): int {
$tag = \Tapp\FilamentLibrary\Models\LibraryItemTag::create([
'name' => $data['name'],
'slug' => \Illuminate\Support\Str::slug($data['name']),
]);

return $tag->id;
}),

\Filament\Forms\Components\Select::make('general_access')
->label('General Access')
->options(function () {
Expand Down
20 changes: 20 additions & 0 deletions src/Resources/Pages/EditFolder.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,26 @@ public function form(\Filament\Schemas\Schema $schema): \Filament\Schemas\Schema
->label('Description')
->rows(3),

\Filament\Forms\Components\Select::make('tags')
->label('Tags')
->relationship('tags', 'name')
->multiple()
->searchable()
->preload()
->createOptionForm([
\Filament\Forms\Components\TextInput::make('name')
->required()
->maxLength(255),
])
->createOptionUsing(function (array $data): int {
$tag = \Tapp\FilamentLibrary\Models\LibraryItemTag::create([
'name' => $data['name'],
'slug' => \Illuminate\Support\Str::slug($data['name']),
]);

return $tag->id;
}),

Select::make('general_access')
->label('General Access')
->options(function () {
Expand Down
20 changes: 20 additions & 0 deletions src/Resources/Pages/EditLink.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,26 @@ public function form(\Filament\Schemas\Schema $schema): \Filament\Schemas\Schema
->label('Description')
->rows(3),

\Filament\Forms\Components\Select::make('tags')
->label('Tags')
->relationship('tags', 'name')
->multiple()
->searchable()
->preload()
->createOptionForm([
\Filament\Forms\Components\TextInput::make('name')
->required()
->maxLength(255),
])
->createOptionUsing(function (array $data): int {
$tag = \Tapp\FilamentLibrary\Models\LibraryItemTag::create([
'name' => $data['name'],
'slug' => \Illuminate\Support\Str::slug($data['name']),
]);

return $tag->id;
}),

\Filament\Forms\Components\Select::make('general_access')
->label('General Access')
->options(function () {
Expand Down
2 changes: 1 addition & 1 deletion src/Resources/Pages/ListLibraryItems.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ protected function getHeaderActions(): array
FileUpload::make('file')
->label('Upload File')
->required()
->maxSize(10240) // 10MB
->maxSize(512000) // 500MB
->disk('public')
->directory('library-files')
->visibility('private')
Expand Down
2 changes: 1 addition & 1 deletion src/Resources/Pages/MyLibrary.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ protected function getHeaderActions(): array
\Filament\Forms\Components\FileUpload::make('file')
->label('Upload File')
->required()
->maxSize(10240) // 10MB
->maxSize(512000) // 500MB
->disk('public')
->directory('library-files')
->visibility('private')
Expand Down