diff --git a/.editorconfig b/.editorconfig index c82b426..abaac5b 100644 --- a/.editorconfig +++ b/.editorconfig @@ -3,13 +3,19 @@ root = true [*] charset = utf-8 end_of_line = lf -indent_size = 4 -indent_style = space insert_final_newline = true +indent_style = space +indent_size = 4 trim_trailing_whitespace = true [*.md] trim_trailing_whitespace = false [*.{yml,yaml}] -indent_size = 2 \ No newline at end of file +indent_size = 2 + +[*.json] +indent_size = 4 + +[docker-compose.yml] +indent_size = 4 diff --git a/.gitattributes b/.gitattributes index 9e9519b..967315d 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,19 +1,5 @@ -# Path-based git attributes -# https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html - -# Ignore all test and documentation with "export-ignore". -/.github export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore -/phpunit.xml.dist export-ignore -/art export-ignore -/docs export-ignore -/tests export-ignore -/.editorconfig export-ignore -/.php_cs.dist.php export-ignore -/psalm.xml export-ignore -/psalm.xml.dist export-ignore -/testbench.yaml export-ignore -/UPGRADING.md export-ignore -/phpstan.neon.dist export-ignore -/phpstan-baseline.neon export-ignore +* text=auto +*.css linguist-vendored +*.scss linguist-vendored +*.js linguist-vendored +CHANGELOG.md export-ignore diff --git a/.gitignore b/.gitignore index 65238c1..9b77006 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,10 @@ /public/hot /public/storage /storage/*.key +/vendor +/build +/vendor/.idea +/bootstrap/cache .env .env.backup .phpunit.result.cache @@ -10,12 +14,7 @@ Homestead.json Homestead.yaml npm-debug.log yarn-error.log -.php-cs-fixer.cache -.idea -build -coverage -phpunit.xml -phpstan.neon -testbench.yaml -vendor -node_modules \ No newline at end of file +/.idea +/.vscode +/pkg +.DS_Store diff --git a/composer.lock b/composer.lock index b4f4930..b8fb1a8 100644 --- a/composer.lock +++ b/composer.lock @@ -1277,16 +1277,16 @@ }, { "name": "filament/filament", - "version": "v2.17.47", + "version": "v2.17.48", "source": { "type": "git", "url": "https://github.com/filamentphp/panels.git", - "reference": "5ffb51c2dc9a6011f9c83b395d6259b0a396a2ca" + "reference": "dd3655e315e825aaed5c98aaf16ed17f37a7b3db" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filamentphp/panels/zipball/5ffb51c2dc9a6011f9c83b395d6259b0a396a2ca", - "reference": "5ffb51c2dc9a6011f9c83b395d6259b0a396a2ca", + "url": "https://api.github.com/repos/filamentphp/panels/zipball/dd3655e315e825aaed5c98aaf16ed17f37a7b3db", + "reference": "dd3655e315e825aaed5c98aaf16ed17f37a7b3db", "shasum": "" }, "require": { @@ -1335,20 +1335,20 @@ "issues": "https://github.com/filamentphp/filament/issues", "source": "https://github.com/filamentphp/filament" }, - "time": "2023-06-11T17:05:35+00:00" + "time": "2023-06-12T14:24:42+00:00" }, { "name": "filament/forms", - "version": "v2.17.47", + "version": "v2.17.48", "source": { "type": "git", "url": "https://github.com/filamentphp/forms.git", - "reference": "23e57101e6e255ff22b2a08b5d5a677575242608" + "reference": "96a4e3ba9ab42d13e8630f0d37f8b83e8cff9eb2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filamentphp/forms/zipball/23e57101e6e255ff22b2a08b5d5a677575242608", - "reference": "23e57101e6e255ff22b2a08b5d5a677575242608", + "url": "https://api.github.com/repos/filamentphp/forms/zipball/96a4e3ba9ab42d13e8630f0d37f8b83e8cff9eb2", + "reference": "96a4e3ba9ab42d13e8630f0d37f8b83e8cff9eb2", "shasum": "" }, "require": { @@ -1393,20 +1393,20 @@ "issues": "https://github.com/filamentphp/filament/issues", "source": "https://github.com/filamentphp/filament" }, - "time": "2023-06-11T17:05:36+00:00" + "time": "2023-06-12T14:24:44+00:00" }, { "name": "filament/notifications", - "version": "v2.17.47", + "version": "v2.17.48", "source": { "type": "git", "url": "https://github.com/filamentphp/notifications.git", - "reference": "2a0a808bff7b6eb036aa7d652e2167c3b3d7bd29" + "reference": "619a730d88943c9415ae1c61085445c2a76199ce" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filamentphp/notifications/zipball/2a0a808bff7b6eb036aa7d652e2167c3b3d7bd29", - "reference": "2a0a808bff7b6eb036aa7d652e2167c3b3d7bd29", + "url": "https://api.github.com/repos/filamentphp/notifications/zipball/619a730d88943c9415ae1c61085445c2a76199ce", + "reference": "619a730d88943c9415ae1c61085445c2a76199ce", "shasum": "" }, "require": { @@ -1446,11 +1446,11 @@ "issues": "https://github.com/filamentphp/filament/issues", "source": "https://github.com/filamentphp/filament" }, - "time": "2023-06-06T11:21:19+00:00" + "time": "2023-06-12T14:24:44+00:00" }, { "name": "filament/spatie-laravel-media-library-plugin", - "version": "v2.17.47", + "version": "v2.17.48", "source": { "type": "git", "url": "https://github.com/filamentphp/spatie-laravel-media-library-plugin.git", @@ -1487,7 +1487,7 @@ }, { "name": "filament/spatie-laravel-tags-plugin", - "version": "v2.17.47", + "version": "v2.17.48", "source": { "type": "git", "url": "https://github.com/filamentphp/spatie-laravel-tags-plugin.git", @@ -1524,7 +1524,7 @@ }, { "name": "filament/spatie-laravel-translatable-plugin", - "version": "v2.17.47", + "version": "v2.17.48", "source": { "type": "git", "url": "https://github.com/filamentphp/spatie-laravel-translatable-plugin.git", @@ -1570,7 +1570,7 @@ }, { "name": "filament/support", - "version": "v2.17.47", + "version": "v2.17.48", "source": { "type": "git", "url": "https://github.com/filamentphp/support.git", @@ -1621,16 +1621,16 @@ }, { "name": "filament/tables", - "version": "v2.17.47", + "version": "v2.17.48", "source": { "type": "git", "url": "https://github.com/filamentphp/tables.git", - "reference": "84529e8c00bd54fb2816c6f0a5a8802e95672c1a" + "reference": "88aef59b52b2643a6536a251794abd3a043e0fc7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filamentphp/tables/zipball/84529e8c00bd54fb2816c6f0a5a8802e95672c1a", - "reference": "84529e8c00bd54fb2816c6f0a5a8802e95672c1a", + "url": "https://api.github.com/repos/filamentphp/tables/zipball/88aef59b52b2643a6536a251794abd3a043e0fc7", + "reference": "88aef59b52b2643a6536a251794abd3a043e0fc7", "shasum": "" }, "require": { @@ -1673,7 +1673,7 @@ "issues": "https://github.com/filamentphp/filament/issues", "source": "https://github.com/filamentphp/filament" }, - "time": "2023-06-07T07:10:56+00:00" + "time": "2023-06-12T14:25:06+00:00" }, { "name": "fruitcake/php-cors", @@ -2094,16 +2094,16 @@ }, { "name": "lara-zeus/core", - "version": "2.4.9", + "version": "2.4.10", "source": { "type": "git", "url": "https://github.com/lara-zeus/core.git", - "reference": "a97fd0ff4fde8b6438ae89e5dc1013784b55df61" + "reference": "dd84ccba8e47540bc26ad40e603e711fdb2a7a43" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/lara-zeus/core/zipball/a97fd0ff4fde8b6438ae89e5dc1013784b55df61", - "reference": "a97fd0ff4fde8b6438ae89e5dc1013784b55df61", + "url": "https://api.github.com/repos/lara-zeus/core/zipball/dd84ccba8e47540bc26ad40e603e711fdb2a7a43", + "reference": "dd84ccba8e47540bc26ad40e603e711fdb2a7a43", "shasum": "" }, "require": { @@ -2166,7 +2166,7 @@ ], "support": { "issues": "https://github.com/lara-zeus/core/issues", - "source": "https://github.com/lara-zeus/core/tree/2.4.9" + "source": "https://github.com/lara-zeus/core/tree/2.4.10" }, "funding": [ { @@ -2174,7 +2174,7 @@ "type": "github" } ], - "time": "2023-06-12T13:17:22+00:00" + "time": "2023-06-13T16:32:19+00:00" }, { "name": "laravel/framework", @@ -8727,24 +8727,24 @@ }, { "name": "orchestra/testbench", - "version": "v8.5.6", + "version": "v8.5.7", "source": { "type": "git", "url": "https://github.com/orchestral/testbench.git", - "reference": "ad082f7dc468ffb879340421fc4d3db6cf5129b6" + "reference": "50eb961e589a5b2df73cb5094a0674aea0609585" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/orchestral/testbench/zipball/ad082f7dc468ffb879340421fc4d3db6cf5129b6", - "reference": "ad082f7dc468ffb879340421fc4d3db6cf5129b6", + "url": "https://api.github.com/repos/orchestral/testbench/zipball/50eb961e589a5b2df73cb5094a0674aea0609585", + "reference": "50eb961e589a5b2df73cb5094a0674aea0609585", "shasum": "" }, "require": { "composer-runtime-api": "^2.2", "fakerphp/faker": "^1.21", - "laravel/framework": ">=10.10.0 <10.15.0", + "laravel/framework": ">=10.13.5 <10.15.0", "mockery/mockery": "^1.5.1", - "orchestra/testbench-core": ">=8.5.6 <8.6.0", + "orchestra/testbench-core": ">=8.5.7 <8.6.0", "php": "^8.1", "phpunit/phpunit": "^9.6 || ^10.1", "spatie/laravel-ray": "^1.32.4", @@ -8776,22 +8776,22 @@ ], "support": { "issues": "https://github.com/orchestral/testbench/issues", - "source": "https://github.com/orchestral/testbench/tree/v8.5.6" + "source": "https://github.com/orchestral/testbench/tree/v8.5.7" }, - "time": "2023-06-11T12:51:04+00:00" + "time": "2023-06-13T06:48:53+00:00" }, { "name": "orchestra/testbench-core", - "version": "v8.5.6", + "version": "v8.5.7", "source": { "type": "git", "url": "https://github.com/orchestral/testbench-core.git", - "reference": "b9295f845d376d51e6a1629c116103e7a55c99c8" + "reference": "c300e901f434809e414fe83325d9750603a017cb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/orchestral/testbench-core/zipball/b9295f845d376d51e6a1629c116103e7a55c99c8", - "reference": "b9295f845d376d51e6a1629c116103e7a55c99c8", + "url": "https://api.github.com/repos/orchestral/testbench-core/zipball/c300e901f434809e414fe83325d9750603a017cb", + "reference": "c300e901f434809e414fe83325d9750603a017cb", "shasum": "" }, "require": { @@ -8800,10 +8800,9 @@ }, "require-dev": { "fakerphp/faker": "^1.21", - "laravel/framework": "^10.10", + "laravel/framework": "^10.13.5", "laravel/pint": "^1.6", "mockery/mockery": "^1.5.1", - "orchestra/canvas": "^8.1", "phpstan/phpstan": "^1.10.7", "phpunit/phpunit": "^10.1", "spatie/laravel-ray": "^1.32.4", @@ -8814,7 +8813,7 @@ "suggest": { "brianium/paratest": "Allow using parallel tresting (^6.4 || ^7.1.4).", "fakerphp/faker": "Allow using Faker for testing (^1.21).", - "laravel/framework": "Required for testing (^10.10).", + "laravel/framework": "Required for testing (^10.13.5).", "mockery/mockery": "Allow using Mockery for testing (^1.5.1).", "nunomaduro/collision": "Allow using Laravel style tests output and parallel testing (^6.4 || ^7.4).", "orchestra/testbench-browser-kit": "Allow using legacy Laravel BrowserKit for testing (^8.0).", @@ -8860,7 +8859,7 @@ "issues": "https://github.com/orchestral/testbench/issues", "source": "https://github.com/orchestral/testbench-core" }, - "time": "2023-06-08T06:22:10+00:00" + "time": "2023-06-13T06:23:28+00:00" }, { "name": "pestphp/pest", @@ -11110,16 +11109,16 @@ }, { "name": "spatie/backtrace", - "version": "1.4.0", + "version": "1.4.1", "source": { "type": "git", "url": "https://github.com/spatie/backtrace.git", - "reference": "ec4dd16476b802dbdc6b4467f84032837e316b8c" + "reference": "47794d19e3215ace9e005a8f200cd7cc7be52572" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/backtrace/zipball/ec4dd16476b802dbdc6b4467f84032837e316b8c", - "reference": "ec4dd16476b802dbdc6b4467f84032837e316b8c", + "url": "https://api.github.com/repos/spatie/backtrace/zipball/47794d19e3215ace9e005a8f200cd7cc7be52572", + "reference": "47794d19e3215ace9e005a8f200cd7cc7be52572", "shasum": "" }, "require": { @@ -11156,7 +11155,7 @@ "spatie" ], "support": { - "source": "https://github.com/spatie/backtrace/tree/1.4.0" + "source": "https://github.com/spatie/backtrace/tree/1.4.1" }, "funding": [ { @@ -11168,7 +11167,7 @@ "type": "other" } ], - "time": "2023-03-04T08:57:24+00:00" + "time": "2023-06-13T14:35:04+00:00" }, { "name": "spatie/laravel-ray", diff --git a/config/zeus-sky.php b/config/zeus-sky.php index 8c81919..e9c5f37 100644 --- a/config/zeus-sky.php +++ b/config/zeus-sky.php @@ -115,4 +115,13 @@ 'IMAGE' => 'Image', 'VIDEO' => 'Video', ], + + /** + * you can add more types to the Tags + */ + 'tags_types' => [ + 'tag' => 'Tag', + 'category' => 'Category', + 'library' => 'Library', + ], ]; diff --git a/src/Filament/Resources/FaqResource.php b/src/Filament/Resources/FaqResource.php index 077d314..c9396be 100644 --- a/src/Filament/Resources/FaqResource.php +++ b/src/Filament/Resources/FaqResource.php @@ -64,7 +64,7 @@ public static function table(Table $table): Table { return $table ->columns([ - TextColumn::make('question'), + TextColumn::make('question')->searchable(), ]) ->actions([ ActionGroup::make([ diff --git a/src/Filament/Resources/LibraryResource.php b/src/Filament/Resources/LibraryResource.php index 3a223e0..f1d4738 100644 --- a/src/Filament/Resources/LibraryResource.php +++ b/src/Filament/Resources/LibraryResource.php @@ -18,6 +18,7 @@ use Filament\Tables\Actions\EditAction; use Filament\Tables\Columns\SpatieTagsColumn; use Filament\Tables\Columns\TextColumn; +use Filament\Tables\Filters\SelectFilter; use Illuminate\Database\Eloquent\Model; use Illuminate\Support\Str; use LaraZeus\Sky\Filament\Resources\LibraryResource\Pages; @@ -111,12 +112,13 @@ public static function table(Table $table): Table { return $table ->columns([ - TextColumn::make('title')->label(__('Library Title')), - TextColumn::make('slug')->label(__('Library Slug')), - TextColumn::make('type')->label(__('Library Type')), + TextColumn::make('title')->label(__('Library Title'))->searchable()->sortable()->toggleable(), + TextColumn::make('slug')->label(__('Library Slug'))->searchable()->sortable()->toggleable(), + TextColumn::make('type')->label(__('Library Type'))->searchable()->sortable()->toggleable(), SpatieTagsColumn::make('tags') ->label(__('Library Tags')) + ->toggleable() ->type('library'), ]) ->actions([ @@ -132,6 +134,15 @@ public static function table(Table $table): Table ->label(__('Delete')), ]), ]) + ->filters([ + SelectFilter::make('type') + ->options(config('zeus-sky.library_types')) + ->label(__('type')), + SelectFilter::make('tags') + ->multiple() + ->relationship('tags', 'name') + ->label(__('Tags')), + ]) ->defaultSort('id', 'desc'); } diff --git a/src/Filament/Resources/PageResource.php b/src/Filament/Resources/PageResource.php index 79a37c8..b51858e 100644 --- a/src/Filament/Resources/PageResource.php +++ b/src/Filament/Resources/PageResource.php @@ -139,12 +139,14 @@ public static function table(Table $table): Table ->label(__('Title')) ->sortable(['title']) ->searchable(['title']) + ->toggleable() ->view('zeus-sky::filament.columns.page-title'), ViewColumn::make('status_desc') ->label(__('Status')) ->sortable(['status']) ->searchable(['status']) + ->toggleable() ->view('zeus-sky::filament.columns.status-desc') ->tooltip(fn (Model $record): string => $record->published_at->format('Y/m/d | H:i A')), ]) @@ -167,7 +169,6 @@ public static function table(Table $table): Table ->multiple() ->label(__('Status')) ->options(config('zeus-sky.models.postStatus')::pluck('label', 'name')), - Filter::make('password') ->label(__('Password Protected')) ->query(fn (Builder $query): Builder => $query->whereNotNull('password')), diff --git a/src/Filament/Resources/PostResource.php b/src/Filament/Resources/PostResource.php index 69d5d86..b9d6324 100644 --- a/src/Filament/Resources/PostResource.php +++ b/src/Filament/Resources/PostResource.php @@ -172,21 +172,25 @@ public static function table(Table $table): Table ->label(__('Title')) ->sortable(['title']) ->searchable(['title']) + ->toggleable() ->view('zeus-sky::filament.columns.post-title'), ViewColumn::make('status_desc') ->label(__('Status')) ->sortable(['status']) ->searchable(['status']) + ->toggleable() ->view('zeus-sky::filament.columns.status-desc') ->tooltip(fn (Model $record): string => $record->published_at->format('Y/m/d | H:i A')), SpatieTagsColumn::make('tags') ->label(__('Post Tags')) + ->toggleable() ->type('tag'), SpatieTagsColumn::make('category') ->label(__('Post Category')) + ->toggleable() ->type('category'), ]) ->defaultSort('id', 'desc') diff --git a/src/Filament/Resources/TagResource.php b/src/Filament/Resources/TagResource.php index 27bfdfc..1512cc3 100644 --- a/src/Filament/Resources/TagResource.php +++ b/src/Filament/Resources/TagResource.php @@ -8,6 +8,7 @@ use Filament\Resources\Form; use Filament\Resources\Table; use Filament\Tables\Columns\TextColumn; +use Filament\Tables\Filters\SelectFilter; use Illuminate\Database\Eloquent\Model; use Illuminate\Support\Str; use LaraZeus\Sky\Filament\Resources\TagResource\Pages; @@ -50,10 +51,7 @@ public static function form(Form $form): Form ->required() ->maxLength(255), Select::make('type') - ->options([ - 'tag' => 'Tag', - 'category' => 'Category', - ]), + ->options(config('zeus-sky.tags_types')), ]); } @@ -61,10 +59,15 @@ public static function table(Table $table): Table { return $table ->columns([ - TextColumn::make('name'), - TextColumn::make('type'), - TextColumn::make('slug'), - TextColumn::make('posts_count')->counts('posts'), + TextColumn::make('name')->toggleable()->searchable()->sortable(), + TextColumn::make('type')->toggleable()->searchable()->sortable(), + TextColumn::make('slug')->toggleable()->searchable()->sortable(), + TextColumn::make('posts_count')->counts('posts')->toggleable()->searchable()->sortable(), + ]) + ->filters([ + SelectFilter::make('type') + ->options(config('zeus-sky.tags_types')) + ->label(__('type')), ]); } diff --git a/src/Http/Livewire/Page.php b/src/Http/Livewire/Page.php index c9eb33e..8dc190e 100644 --- a/src/Http/Livewire/Page.php +++ b/src/Http/Livewire/Page.php @@ -36,7 +36,6 @@ public function render() return view(app('theme') . '.page') ->with([ 'post' => $this->page, - /** @phpstan-ignore-next-line */ 'children' => config('zeus-sky.models.post')::with('parent')->where('parent_id', $this->page->id)->get(), ]) ->layout(config('zeus-sky.layout')); diff --git a/src/Models/Library.php b/src/Models/Library.php index 31b6a8e..a28ea1f 100644 --- a/src/Models/Library.php +++ b/src/Models/Library.php @@ -5,7 +5,6 @@ use Database\Factories\LibraryFactory; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; -use Illuminate\Support\Carbon; use Spatie\MediaLibrary\HasMedia; use Spatie\MediaLibrary\InteractsWithMedia; use Spatie\Tags\HasTags; @@ -15,7 +14,8 @@ * @property string $slug * @property string $title * @property string $description - * @property Carbon $file + * @property string $file + * @property string $file_path */ class Library extends Model implements HasMedia {