diff --git a/README.md b/README.md index 4c637e9..817fadf 100644 --- a/README.md +++ b/README.md @@ -93,7 +93,7 @@ Please see [CONTRIBUTING](CONTRIBUTING.md) for details. ## Security -If you discover any security related issues, please email wh7r.com@gmail.com instead of using the issue tracker. +If you discover any security related issues, please email info@larazeus.com instead of using the issue tracker. ## Credits diff --git a/composer.json b/composer.json index 4aa6112..769d503 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,8 @@ "news", "wordpress laravel", "wordpress alternative", - "laravel cms" + "laravel cms", + "filamentphp" ], "homepage": "https://larazeus.com", "license": "MIT", @@ -20,7 +21,7 @@ "authors": [ { "name": "php coder", - "email": "wh7r.com@gmail.com", + "email": "info@larazeus.com", "role": "Owner" } ], diff --git a/composer.lock b/composer.lock index c4f76a4..4408967 100644 --- a/composer.lock +++ b/composer.lock @@ -1281,16 +1281,16 @@ }, { "name": "filament/filament", - "version": "v2.17.44", + "version": "v2.17.45", "source": { "type": "git", "url": "https://github.com/filamentphp/panels.git", - "reference": "a7658bd50da4b35322f1c1616de4b6abd7a6b7a8" + "reference": "bacf17f6b59fa28ced9e3c51a555e37c7df080e8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filamentphp/panels/zipball/a7658bd50da4b35322f1c1616de4b6abd7a6b7a8", - "reference": "a7658bd50da4b35322f1c1616de4b6abd7a6b7a8", + "url": "https://api.github.com/repos/filamentphp/panels/zipball/bacf17f6b59fa28ced9e3c51a555e37c7df080e8", + "reference": "bacf17f6b59fa28ced9e3c51a555e37c7df080e8", "shasum": "" }, "require": { @@ -1311,7 +1311,6 @@ "illuminate/view": "^8.6|^9.0|^10.0", "livewire/livewire": "^2.10.7", "php": "^8.0", - "ryangjchandler/blade-capture-directive": "^0.2|^0.3", "spatie/laravel-package-tools": "^1.9" }, "type": "library", @@ -1340,20 +1339,20 @@ "issues": "https://github.com/filamentphp/filament/issues", "source": "https://github.com/filamentphp/filament" }, - "time": "2023-05-30T10:44:54+00:00" + "time": "2023-06-06T11:21:28+00:00" }, { "name": "filament/forms", - "version": "v2.17.44", + "version": "v2.17.45", "source": { "type": "git", "url": "https://github.com/filamentphp/forms.git", - "reference": "c6b5d4f04716f14a4d5f63f76c8b94df8029a17f" + "reference": "b41dc730783813f5622a9bad5f81a767fe94f7af" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filamentphp/forms/zipball/c6b5d4f04716f14a4d5f63f76c8b94df8029a17f", - "reference": "c6b5d4f04716f14a4d5f63f76c8b94df8029a17f", + "url": "https://api.github.com/repos/filamentphp/forms/zipball/b41dc730783813f5622a9bad5f81a767fe94f7af", + "reference": "b41dc730783813f5622a9bad5f81a767fe94f7af", "shasum": "" }, "require": { @@ -1398,20 +1397,20 @@ "issues": "https://github.com/filamentphp/filament/issues", "source": "https://github.com/filamentphp/filament" }, - "time": "2023-05-30T10:44:57+00:00" + "time": "2023-06-06T11:21:25+00:00" }, { "name": "filament/notifications", - "version": "v2.17.44", + "version": "v2.17.45", "source": { "type": "git", "url": "https://github.com/filamentphp/notifications.git", - "reference": "a9bee8c8b7cdf1df798311acdf57895d73dd3af7" + "reference": "2a0a808bff7b6eb036aa7d652e2167c3b3d7bd29" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filamentphp/notifications/zipball/a9bee8c8b7cdf1df798311acdf57895d73dd3af7", - "reference": "a9bee8c8b7cdf1df798311acdf57895d73dd3af7", + "url": "https://api.github.com/repos/filamentphp/notifications/zipball/2a0a808bff7b6eb036aa7d652e2167c3b3d7bd29", + "reference": "2a0a808bff7b6eb036aa7d652e2167c3b3d7bd29", "shasum": "" }, "require": { @@ -1451,11 +1450,11 @@ "issues": "https://github.com/filamentphp/filament/issues", "source": "https://github.com/filamentphp/filament" }, - "time": "2023-05-30T10:44:51+00:00" + "time": "2023-06-06T11:21:19+00:00" }, { "name": "filament/spatie-laravel-media-library-plugin", - "version": "v2.17.44", + "version": "v2.17.45", "source": { "type": "git", "url": "https://github.com/filamentphp/spatie-laravel-media-library-plugin.git", @@ -1492,7 +1491,7 @@ }, { "name": "filament/spatie-laravel-tags-plugin", - "version": "v2.17.44", + "version": "v2.17.45", "source": { "type": "git", "url": "https://github.com/filamentphp/spatie-laravel-tags-plugin.git", @@ -1529,7 +1528,7 @@ }, { "name": "filament/spatie-laravel-translatable-plugin", - "version": "v2.17.44", + "version": "v2.17.45", "source": { "type": "git", "url": "https://github.com/filamentphp/spatie-laravel-translatable-plugin.git", @@ -1575,16 +1574,16 @@ }, { "name": "filament/support", - "version": "v2.17.44", + "version": "v2.17.45", "source": { "type": "git", "url": "https://github.com/filamentphp/support.git", - "reference": "fe7434dd07b254de0d9cc7d9178540ad8b087cca" + "reference": "2fc7b60416283c17a7b8ce2f8d65d4d02ed766fb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filamentphp/support/zipball/fe7434dd07b254de0d9cc7d9178540ad8b087cca", - "reference": "fe7434dd07b254de0d9cc7d9178540ad8b087cca", + "url": "https://api.github.com/repos/filamentphp/support/zipball/2fc7b60416283c17a7b8ce2f8d65d4d02ed766fb", + "reference": "2fc7b60416283c17a7b8ce2f8d65d4d02ed766fb", "shasum": "" }, "require": { @@ -1592,6 +1591,7 @@ "illuminate/support": "^8.6|^9.0|^10.0", "illuminate/view": "^8.6|^9.0|^10.0", "php": "^8.0", + "ryangjchandler/blade-capture-directive": "^0.2|^0.3", "spatie/laravel-package-tools": "^1.9", "tgalopin/html-sanitizer": "^1.5" }, @@ -1621,20 +1621,20 @@ "issues": "https://github.com/filamentphp/filament/issues", "source": "https://github.com/filamentphp/filament" }, - "time": "2023-05-30T10:44:54+00:00" + "time": "2023-06-06T11:21:22+00:00" }, { "name": "filament/tables", - "version": "v2.17.44", + "version": "v2.17.45", "source": { "type": "git", "url": "https://github.com/filamentphp/tables.git", - "reference": "57833d3f09c6ec5fbbabec5a0e47944b972ceaa3" + "reference": "4993ac5c3ceee89f29e97c79a4682899166074ac" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filamentphp/tables/zipball/57833d3f09c6ec5fbbabec5a0e47944b972ceaa3", - "reference": "57833d3f09c6ec5fbbabec5a0e47944b972ceaa3", + "url": "https://api.github.com/repos/filamentphp/tables/zipball/4993ac5c3ceee89f29e97c79a4682899166074ac", + "reference": "4993ac5c3ceee89f29e97c79a4682899166074ac", "shasum": "" }, "require": { @@ -1677,7 +1677,7 @@ "issues": "https://github.com/filamentphp/filament/issues", "source": "https://github.com/filamentphp/filament" }, - "time": "2023-05-30T10:44:53+00:00" + "time": "2023-06-06T11:21:20+00:00" }, { "name": "fruitcake/php-cors", @@ -2098,16 +2098,16 @@ }, { "name": "lara-zeus/core", - "version": "2.4.7", + "version": "2.4.8", "source": { "type": "git", "url": "https://github.com/lara-zeus/core.git", - "reference": "b264c114c56e42ee64e8805f3d0017b774526024" + "reference": "1554b95e1f79d781adbb47f6f84a9d5cc2201f6f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/lara-zeus/core/zipball/b264c114c56e42ee64e8805f3d0017b774526024", - "reference": "b264c114c56e42ee64e8805f3d0017b774526024", + "url": "https://api.github.com/repos/lara-zeus/core/zipball/1554b95e1f79d781adbb47f6f84a9d5cc2201f6f", + "reference": "1554b95e1f79d781adbb47f6f84a9d5cc2201f6f", "shasum": "" }, "require": { @@ -2170,7 +2170,7 @@ ], "support": { "issues": "https://github.com/lara-zeus/core/issues", - "source": "https://github.com/lara-zeus/core/tree/2.4.7" + "source": "https://github.com/lara-zeus/core/tree/2.4.8" }, "funding": [ { @@ -2178,20 +2178,20 @@ "type": "github" } ], - "time": "2023-06-04T21:29:55+00:00" + "time": "2023-06-06T13:45:27+00:00" }, { "name": "laravel/framework", - "version": "v10.13.1", + "version": "v10.13.2", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "c1569099594168870cb4bdabfbaa35e5d172310b" + "reference": "fd4619b56b56308e2c2c1840fedd0b8ebb73dfc5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/c1569099594168870cb4bdabfbaa35e5d172310b", - "reference": "c1569099594168870cb4bdabfbaa35e5d172310b", + "url": "https://api.github.com/repos/laravel/framework/zipball/fd4619b56b56308e2c2c1840fedd0b8ebb73dfc5", + "reference": "fd4619b56b56308e2c2c1840fedd0b8ebb73dfc5", "shasum": "" }, "require": { @@ -2378,7 +2378,7 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2023-06-02T13:13:10+00:00" + "time": "2023-06-05T15:48:15+00:00" }, { "name": "laravel/serializable-closure", @@ -4812,16 +4812,16 @@ }, { "name": "spatie/laravel-medialibrary", - "version": "10.9.3", + "version": "10.9.4", "source": { "type": "git", "url": "https://github.com/spatie/laravel-medialibrary.git", - "reference": "c7eae00741a571f5049f1f1c4090683de8df420c" + "reference": "22581bc5578bb7984ab025a41e33baf3f154d093" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/laravel-medialibrary/zipball/c7eae00741a571f5049f1f1c4090683de8df420c", - "reference": "c7eae00741a571f5049f1f1c4090683de8df420c", + "url": "https://api.github.com/repos/spatie/laravel-medialibrary/zipball/22581bc5578bb7984ab025a41e33baf3f154d093", + "reference": "22581bc5578bb7984ab025a41e33baf3f154d093", "shasum": "" }, "require": { @@ -4905,7 +4905,7 @@ ], "support": { "issues": "https://github.com/spatie/laravel-medialibrary/issues", - "source": "https://github.com/spatie/laravel-medialibrary/tree/10.9.3" + "source": "https://github.com/spatie/laravel-medialibrary/tree/10.9.4" }, "funding": [ { @@ -4917,7 +4917,7 @@ "type": "github" } ], - "time": "2023-05-22T12:59:16+00:00" + "time": "2023-06-06T13:03:40+00:00" }, { "name": "spatie/laravel-package-tools", @@ -8354,28 +8354,30 @@ }, { "name": "mockery/mockery", - "version": "1.5.1", + "version": "1.6.1", "source": { "type": "git", "url": "https://github.com/mockery/mockery.git", - "reference": "e92dcc83d5a51851baf5f5591d32cb2b16e3684e" + "reference": "a8dd186f07ea667c1e3abd2176bfab0ab161ea94" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mockery/mockery/zipball/e92dcc83d5a51851baf5f5591d32cb2b16e3684e", - "reference": "e92dcc83d5a51851baf5f5591d32cb2b16e3684e", + "url": "https://api.github.com/repos/mockery/mockery/zipball/a8dd186f07ea667c1e3abd2176bfab0ab161ea94", + "reference": "a8dd186f07ea667c1e3abd2176bfab0ab161ea94", "shasum": "" }, "require": { "hamcrest/hamcrest-php": "^2.0.1", "lib-pcre": ">=7.0", - "php": "^7.3 || ^8.0" + "php": "^7.4 || ^8.0" }, "conflict": { "phpunit/phpunit": "<8.0" }, "require-dev": { - "phpunit/phpunit": "^8.5 || ^9.3" + "phpunit/phpunit": "^8.5 || ^9.3", + "psalm/plugin-phpunit": "^0.18", + "vimeo/psalm": "^5.9" }, "type": "library", "extra": { @@ -8384,8 +8386,12 @@ } }, "autoload": { - "psr-0": { - "Mockery": "library/" + "files": [ + "library/helpers.php", + "library/Mockery.php" + ], + "psr-4": { + "Mockery\\": "library/Mockery" } }, "notification-url": "https://packagist.org/downloads/", @@ -8420,9 +8426,9 @@ ], "support": { "issues": "https://github.com/mockery/mockery/issues", - "source": "https://github.com/mockery/mockery/tree/1.5.1" + "source": "https://github.com/mockery/mockery/tree/1.6.1" }, - "time": "2022-09-07T15:32:08+00:00" + "time": "2023-06-05T13:59:03+00:00" }, { "name": "myclabs/deep-copy", @@ -8629,16 +8635,16 @@ }, { "name": "nunomaduro/larastan", - "version": "v2.6.0", + "version": "v2.6.1", "source": { "type": "git", "url": "https://github.com/nunomaduro/larastan.git", - "reference": "ccac5b25949576807862cf32ba1fce1769c06c42" + "reference": "7823bc1fdbd8e72fd1e9cd8d746e7e104bccf02c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nunomaduro/larastan/zipball/ccac5b25949576807862cf32ba1fce1769c06c42", - "reference": "ccac5b25949576807862cf32ba1fce1769c06c42", + "url": "https://api.github.com/repos/nunomaduro/larastan/zipball/7823bc1fdbd8e72fd1e9cd8d746e7e104bccf02c", + "reference": "7823bc1fdbd8e72fd1e9cd8d746e7e104bccf02c", "shasum": "" }, "require": { @@ -8701,7 +8707,7 @@ ], "support": { "issues": "https://github.com/nunomaduro/larastan/issues", - "source": "https://github.com/nunomaduro/larastan/tree/v2.6.0" + "source": "https://github.com/nunomaduro/larastan/tree/v2.6.1" }, "funding": [ { @@ -8721,7 +8727,7 @@ "type": "patreon" } ], - "time": "2023-04-20T12:40:01+00:00" + "time": "2023-06-04T20:55:57+00:00" }, { "name": "orchestra/testbench", @@ -9377,16 +9383,16 @@ }, { "name": "phpmyadmin/sql-parser", - "version": "5.7.0", + "version": "5.8.0", "source": { "type": "git", "url": "https://github.com/phpmyadmin/sql-parser.git", - "reference": "0f5895aab2b6002d00b6831b60983523dea30bff" + "reference": "db1b3069b5dbc220d393d67ff911e0ae76732755" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpmyadmin/sql-parser/zipball/0f5895aab2b6002d00b6831b60983523dea30bff", - "reference": "0f5895aab2b6002d00b6831b60983523dea30bff", + "url": "https://api.github.com/repos/phpmyadmin/sql-parser/zipball/db1b3069b5dbc220d393d67ff911e0ae76732755", + "reference": "db1b3069b5dbc220d393d67ff911e0ae76732755", "shasum": "" }, "require": { @@ -9460,7 +9466,7 @@ "type": "other" } ], - "time": "2023-01-25T10:43:40+00:00" + "time": "2023-06-05T18:19:38+00:00" }, { "name": "phpstan/extension-installer", @@ -9508,16 +9514,16 @@ }, { "name": "phpstan/phpstan", - "version": "1.10.15", + "version": "1.10.16", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "762c4dac4da6f8756eebb80e528c3a47855da9bd" + "reference": "352bdbb960bb523e3d71b834862589f910921c23" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/762c4dac4da6f8756eebb80e528c3a47855da9bd", - "reference": "762c4dac4da6f8756eebb80e528c3a47855da9bd", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/352bdbb960bb523e3d71b834862589f910921c23", + "reference": "352bdbb960bb523e3d71b834862589f910921c23", "shasum": "" }, "require": { @@ -9566,7 +9572,7 @@ "type": "tidelift" } ], - "time": "2023-05-09T15:28:01+00:00" + "time": "2023-06-05T08:21:46+00:00" }, { "name": "phpstan/phpstan-deprecation-rules", diff --git a/resources/views/filament/columns/page-title.blade.php b/resources/views/filament/columns/page-title.blade.php index f8db9a4..cabe08f 100644 --- a/resources/views/filament/columns/page-title.blade.php +++ b/resources/views/filament/columns/page-title.blade.php @@ -1,10 +1,8 @@ - -
- @if($getRecord()->password !== null) - - - - @endif - {{ $getRecord()->title }} -
-
+
+ @if($getRecord()->password !== null) + + + + @endif + {{ $getRecord()->title }} +
diff --git a/resources/views/filament/columns/post-title.blade.php b/resources/views/filament/columns/post-title.blade.php index aaa650f..9a055d5 100644 --- a/resources/views/filament/columns/post-title.blade.php +++ b/resources/views/filament/columns/post-title.blade.php @@ -1,17 +1,15 @@ - -
- @if($getRecord()->password !== null) - - - - @endif +
+ @if($getRecord()->password !== null) + + + + @endif - @if($getRecord()->sticky_until !== null) - - - - @endif + @if($getRecord()->sticky_until !== null) + + + + @endif - {{ $getRecord()->title }} -
-
+ {{ $getRecord()->title }} +
diff --git a/src/Filament/Resources/FaqResource.php b/src/Filament/Resources/FaqResource.php index e14ee80..077d314 100644 --- a/src/Filament/Resources/FaqResource.php +++ b/src/Filament/Resources/FaqResource.php @@ -6,6 +6,9 @@ use Filament\Forms\Components\Textarea; use Filament\Resources\Form; use Filament\Resources\Table; +use Filament\Tables\Actions\ActionGroup; +use Filament\Tables\Actions\DeleteAction; +use Filament\Tables\Actions\EditAction; use Filament\Tables\Columns\TextColumn; use LaraZeus\Sky\Filament\Resources\FaqResource\Pages; use LaraZeus\Sky\Models\Faq; @@ -62,6 +65,13 @@ public static function table(Table $table): Table return $table ->columns([ TextColumn::make('question'), + ]) + ->actions([ + ActionGroup::make([ + EditAction::make('edit')->label(__('Edit')), + DeleteAction::make('delete') + ->label(__('Delete')), + ]), ]); } diff --git a/src/Filament/Resources/FaqResource/Pages/ListFaqs.php b/src/Filament/Resources/FaqResource/Pages/ListFaqs.php index f29e6f5..ccda9a2 100644 --- a/src/Filament/Resources/FaqResource/Pages/ListFaqs.php +++ b/src/Filament/Resources/FaqResource/Pages/ListFaqs.php @@ -2,6 +2,9 @@ namespace LaraZeus\Sky\Filament\Resources\FaqResource\Pages; +use Filament\Pages\Actions\Action; +use Filament\Pages\Actions\CreateAction; +use Filament\Pages\Actions\LocaleSwitcher; use Filament\Resources\Pages\ListRecords; use LaraZeus\Sky\Filament\Resources\FaqResource; @@ -10,4 +13,18 @@ class ListFaqs extends ListRecords use ListRecords\Concerns\Translatable; protected static string $resource = FaqResource::class; + + protected function getActions(): array + { + return [ + CreateAction::make(), + Action::make('Open') + ->color('warning') + ->icon('heroicon-o-external-link') + ->label(__('Open')) + ->url(fn (): string => route('faq')) + ->openUrlInNewTab(), + LocaleSwitcher::make(), + ]; + } } diff --git a/src/Filament/Resources/LibraryResource.php b/src/Filament/Resources/LibraryResource.php index f3ccd0b..3a223e0 100644 --- a/src/Filament/Resources/LibraryResource.php +++ b/src/Filament/Resources/LibraryResource.php @@ -12,6 +12,10 @@ use Filament\Forms\Components\TextInput; use Filament\Resources\Form; use Filament\Resources\Table; +use Filament\Tables\Actions\Action; +use Filament\Tables\Actions\ActionGroup; +use Filament\Tables\Actions\DeleteAction; +use Filament\Tables\Actions\EditAction; use Filament\Tables\Columns\SpatieTagsColumn; use Filament\Tables\Columns\TextColumn; use Illuminate\Database\Eloquent\Model; @@ -115,6 +119,19 @@ public static function table(Table $table): Table ->label(__('Library Tags')) ->type('library'), ]) + ->actions([ + ActionGroup::make([ + EditAction::make('edit')->label(__('Edit')), + Action::make('Open') + ->color('warning') + ->icon('heroicon-o-external-link') + ->label(__('Open')) + ->url(fn (Model $record): string => route('library.item', ['slug' => $record->slug])) + ->openUrlInNewTab(), + DeleteAction::make('delete') + ->label(__('Delete')), + ]), + ]) ->defaultSort('id', 'desc'); } diff --git a/src/Filament/Resources/PageResource.php b/src/Filament/Resources/PageResource.php index d0edcaa..79a37c8 100644 --- a/src/Filament/Resources/PageResource.php +++ b/src/Filament/Resources/PageResource.php @@ -14,6 +14,10 @@ use Filament\Forms\Components\TextInput; use Filament\Resources\Form; use Filament\Resources\Table; +use Filament\Tables\Actions\Action; +use Filament\Tables\Actions\ActionGroup; +use Filament\Tables\Actions\DeleteAction; +use Filament\Tables\Actions\EditAction; use Filament\Tables\Columns\ViewColumn; use Filament\Tables\Filters\Filter; use Filament\Tables\Filters\SelectFilter; @@ -21,14 +25,13 @@ use Illuminate\Database\Eloquent\Model; use Illuminate\Support\Str; use LaraZeus\Sky\Filament\Resources\PageResource\Pages; -use LaraZeus\Sky\Models\Post; use Mohamedsabil83\FilamentFormsTinyeditor\Components\TinyEditor; class PageResource extends SkyResource { public static function getModel(): string { - return config('zeus-sky.models.post') ?? Post::class; + return config('zeus-sky.models.post'); } protected static ?string $slug = 'pages'; @@ -143,9 +146,22 @@ public static function table(Table $table): Table ->sortable(['status']) ->searchable(['status']) ->view('zeus-sky::filament.columns.status-desc') - ->tooltip(fn (Post $record): string => $record->published_at->format('Y/m/d | H:i A')), + ->tooltip(fn (Model $record): string => $record->published_at->format('Y/m/d | H:i A')), ]) ->defaultSort('id', 'desc') + ->actions([ + ActionGroup::make([ + EditAction::make('edit')->label(__('Edit')), + Action::make('Open') + ->color('warning') + ->icon('heroicon-o-external-link') + ->label(__('Open')) + ->url(fn (Model $record): string => route('page', ['slug' => $record])) + ->openUrlInNewTab(), + DeleteAction::make('delete') + ->label(__('Delete')), + ]), + ]) ->filters([ SelectFilter::make('status') ->multiple() diff --git a/src/Filament/Resources/PostResource.php b/src/Filament/Resources/PostResource.php index da3b9f8..69d5d86 100644 --- a/src/Filament/Resources/PostResource.php +++ b/src/Filament/Resources/PostResource.php @@ -16,6 +16,10 @@ use Filament\Forms\Components\TextInput; use Filament\Resources\Form; use Filament\Resources\Table; +use Filament\Tables\Actions\Action; +use Filament\Tables\Actions\ActionGroup; +use Filament\Tables\Actions\DeleteAction; +use Filament\Tables\Actions\EditAction; use Filament\Tables\Columns\SpatieTagsColumn; use Filament\Tables\Columns\ViewColumn; use Filament\Tables\Filters\Filter; @@ -24,7 +28,6 @@ use Illuminate\Database\Eloquent\Model; use Illuminate\Support\Str; use LaraZeus\Sky\Filament\Resources\PostResource\Pages; -use LaraZeus\Sky\Models\Post; use Mohamedsabil83\FilamentFormsTinyeditor\Components\TinyEditor; class PostResource extends SkyResource @@ -176,7 +179,7 @@ public static function table(Table $table): Table ->sortable(['status']) ->searchable(['status']) ->view('zeus-sky::filament.columns.status-desc') - ->tooltip(fn (Post $record): string => $record->published_at->format('Y/m/d | H:i A')), + ->tooltip(fn (Model $record): string => $record->published_at->format('Y/m/d | H:i A')), SpatieTagsColumn::make('tags') ->label(__('Post Tags')) @@ -187,6 +190,19 @@ public static function table(Table $table): Table ->type('category'), ]) ->defaultSort('id', 'desc') + ->actions([ + ActionGroup::make([ + EditAction::make('edit')->label(__('Edit')), + Action::make('Open') + ->color('warning') + ->icon('heroicon-o-external-link') + ->label(__('Open')) + ->url(fn (Model $record): string => route('post', ['slug' => $record])) + ->openUrlInNewTab(), + DeleteAction::make('delete') + ->label(__('Delete')), + ]), + ]) ->filters([ SelectFilter::make('status') ->multiple()