From 019a5cffc9ffee0f4382858209c1e64e139f09d6 Mon Sep 17 00:00:00 2001 From: Dan Pock Date: Tue, 5 Mar 2024 14:37:25 -0500 Subject: [PATCH 1/2] fix page/post count being the same --- src/Filament/Resources/PageResource.php | 5 +++++ src/Filament/Resources/PostResource.php | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/src/Filament/Resources/PageResource.php b/src/Filament/Resources/PageResource.php index f070eda..ca3d57a 100644 --- a/src/Filament/Resources/PageResource.php +++ b/src/Filament/Resources/PageResource.php @@ -216,6 +216,11 @@ public static function getNavigationLabel(): string return __('Pages'); } + public static function getNavigationBadge(): ?string + { + return (string) static::getEloquentQuery()->page()->count(); + } + public static function getActions(): array { $action = [ diff --git a/src/Filament/Resources/PostResource.php b/src/Filament/Resources/PostResource.php index 70af34e..95296ea 100644 --- a/src/Filament/Resources/PostResource.php +++ b/src/Filament/Resources/PostResource.php @@ -258,6 +258,11 @@ public static function getNavigationLabel(): string return __('Posts'); } + public static function getNavigationBadge(): ?string + { + return (string) static::getEloquentQuery()->posts()->count(); + } + public static function getActions(): array { $action = [ From 26a0ab11b6bae5bd6e3e432acde26a49905bcf19 Mon Sep 17 00:00:00 2001 From: Ash Monsh Date: Tue, 5 Mar 2024 23:18:21 +0300 Subject: [PATCH 2/2] separate the published_at from the page and posts scope --- .github/workflows/run-tests.yml | 2 +- composer.lock | 300 ++++++++++++------------ src/Classes/RenderNavItem.php | 2 +- src/Filament/Resources/PageResource.php | 2 +- src/Filament/Resources/PostResource.php | 2 +- src/Livewire/Page.php | 6 +- src/Livewire/Posts.php | 8 +- src/Models/PostScope.php | 6 +- src/SkyServiceProvider.php | 5 +- 9 files changed, 175 insertions(+), 158 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index bf81e50..5edbaaf 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -13,7 +13,7 @@ jobs: fail-fast: true matrix: os: [ubuntu-latest, windows-latest] - php: [8.1] + php: [8.2] laravel: [10.*] stability: [prefer-stable] include: diff --git a/composer.lock b/composer.lock index d372083..b315dba 100644 --- a/composer.lock +++ b/composer.lock @@ -8,21 +8,21 @@ "packages": [ { "name": "anourvalar/eloquent-serialize", - "version": "1.2.18", + "version": "1.2.19", "source": { "type": "git", "url": "https://github.com/AnourValar/eloquent-serialize.git", - "reference": "ea37278f305215bb763d8e901cd8fd448462a8af" + "reference": "7ab1be9b9d9a2369643b5e58796cd43717b9b5c3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/AnourValar/eloquent-serialize/zipball/ea37278f305215bb763d8e901cd8fd448462a8af", - "reference": "ea37278f305215bb763d8e901cd8fd448462a8af", + "url": "https://api.github.com/repos/AnourValar/eloquent-serialize/zipball/7ab1be9b9d9a2369643b5e58796cd43717b9b5c3", + "reference": "7ab1be9b9d9a2369643b5e58796cd43717b9b5c3", "shasum": "" }, "require": { "laravel/framework": "^6.0|^7.0|^8.0|^9.0|^10.0|^11.0", - "php": "^7.1|^8.0" + "php": "^7.4|^8.0" }, "require-dev": { "friendsofphp/php-cs-fixer": "^3.26", @@ -68,9 +68,9 @@ ], "support": { "issues": "https://github.com/AnourValar/eloquent-serialize/issues", - "source": "https://github.com/AnourValar/eloquent-serialize/tree/1.2.18" + "source": "https://github.com/AnourValar/eloquent-serialize/tree/1.2.19" }, - "time": "2024-02-25T11:04:10+00:00" + "time": "2024-03-03T05:05:13+00:00" }, { "name": "archtechx/laravel-seo", @@ -803,16 +803,16 @@ }, { "name": "doctrine/dbal", - "version": "3.8.2", + "version": "3.8.3", "source": { "type": "git", "url": "https://github.com/doctrine/dbal.git", - "reference": "a19a1d05ca211f41089dffcc387733a6875196cb" + "reference": "db922ba9436b7b18a23d1653a0b41ff2369ca41c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/dbal/zipball/a19a1d05ca211f41089dffcc387733a6875196cb", - "reference": "a19a1d05ca211f41089dffcc387733a6875196cb", + "url": "https://api.github.com/repos/doctrine/dbal/zipball/db922ba9436b7b18a23d1653a0b41ff2369ca41c", + "reference": "db922ba9436b7b18a23d1653a0b41ff2369ca41c", "shasum": "" }, "require": { @@ -828,12 +828,12 @@ "doctrine/coding-standard": "12.0.0", "fig/log-test": "^1", "jetbrains/phpstorm-stubs": "2023.1", - "phpstan/phpstan": "1.10.57", + "phpstan/phpstan": "1.10.58", "phpstan/phpstan-strict-rules": "^1.5", "phpunit/phpunit": "9.6.16", "psalm/plugin-phpunit": "0.18.4", "slevomat/coding-standard": "8.13.1", - "squizlabs/php_codesniffer": "3.8.1", + "squizlabs/php_codesniffer": "3.9.0", "symfony/cache": "^5.4|^6.0|^7.0", "symfony/console": "^4.4|^5.4|^6.0|^7.0", "vimeo/psalm": "4.30.0" @@ -896,7 +896,7 @@ ], "support": { "issues": "https://github.com/doctrine/dbal/issues", - "source": "https://github.com/doctrine/dbal/tree/3.8.2" + "source": "https://github.com/doctrine/dbal/tree/3.8.3" }, "funding": [ { @@ -912,7 +912,7 @@ "type": "tidelift" } ], - "time": "2024-02-12T18:36:36+00:00" + "time": "2024-03-03T15:55:06+00:00" }, { "name": "doctrine/deprecations", @@ -1350,16 +1350,16 @@ }, { "name": "filament/actions", - "version": "v3.2.42", + "version": "v3.2.44", "source": { "type": "git", "url": "https://github.com/filamentphp/actions.git", - "reference": "7e7bd61e30504cd69d3f0a1127459feb30b3e6e0" + "reference": "e64667172371b0993c28032eeb34dd6fc63cc603" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filamentphp/actions/zipball/7e7bd61e30504cd69d3f0a1127459feb30b3e6e0", - "reference": "7e7bd61e30504cd69d3f0a1127459feb30b3e6e0", + "url": "https://api.github.com/repos/filamentphp/actions/zipball/e64667172371b0993c28032eeb34dd6fc63cc603", + "reference": "e64667172371b0993c28032eeb34dd6fc63cc603", "shasum": "" }, "require": { @@ -1399,20 +1399,20 @@ "issues": "https://github.com/filamentphp/filament/issues", "source": "https://github.com/filamentphp/filament" }, - "time": "2024-03-01T12:23:55+00:00" + "time": "2024-03-05T14:33:19+00:00" }, { "name": "filament/filament", - "version": "v3.2.42", + "version": "v3.2.44", "source": { "type": "git", "url": "https://github.com/filamentphp/panels.git", - "reference": "fcf48e0e3edd35293b3f0ace00c98a77a2201d83" + "reference": "02313102899d3964cad22b6d96cbe731a6a5b999" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filamentphp/panels/zipball/fcf48e0e3edd35293b3f0ace00c98a77a2201d83", - "reference": "fcf48e0e3edd35293b3f0ace00c98a77a2201d83", + "url": "https://api.github.com/repos/filamentphp/panels/zipball/02313102899d3964cad22b6d96cbe731a6a5b999", + "reference": "02313102899d3964cad22b6d96cbe731a6a5b999", "shasum": "" }, "require": { @@ -1464,20 +1464,20 @@ "issues": "https://github.com/filamentphp/filament/issues", "source": "https://github.com/filamentphp/filament" }, - "time": "2024-03-01T12:24:07+00:00" + "time": "2024-03-05T14:33:38+00:00" }, { "name": "filament/forms", - "version": "v3.2.42", + "version": "v3.2.44", "source": { "type": "git", "url": "https://github.com/filamentphp/forms.git", - "reference": "d0812d121f1f51077fc82dd94a4d982924cb5ccf" + "reference": "de893403d9fd18c5b34dbec1579e387721477e3c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filamentphp/forms/zipball/d0812d121f1f51077fc82dd94a4d982924cb5ccf", - "reference": "d0812d121f1f51077fc82dd94a4d982924cb5ccf", + "url": "https://api.github.com/repos/filamentphp/forms/zipball/de893403d9fd18c5b34dbec1579e387721477e3c", + "reference": "de893403d9fd18c5b34dbec1579e387721477e3c", "shasum": "" }, "require": { @@ -1520,20 +1520,20 @@ "issues": "https://github.com/filamentphp/filament/issues", "source": "https://github.com/filamentphp/filament" }, - "time": "2024-03-01T12:23:31+00:00" + "time": "2024-03-05T14:33:15+00:00" }, { "name": "filament/infolists", - "version": "v3.2.42", + "version": "v3.2.44", "source": { "type": "git", "url": "https://github.com/filamentphp/infolists.git", - "reference": "eda6ac94ae24f0cd87d77aae8812b1472a25c8fd" + "reference": "9d13f101531ef920961967f1e4501540a22e1659" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filamentphp/infolists/zipball/eda6ac94ae24f0cd87d77aae8812b1472a25c8fd", - "reference": "eda6ac94ae24f0cd87d77aae8812b1472a25c8fd", + "url": "https://api.github.com/repos/filamentphp/infolists/zipball/9d13f101531ef920961967f1e4501540a22e1659", + "reference": "9d13f101531ef920961967f1e4501540a22e1659", "shasum": "" }, "require": { @@ -1571,11 +1571,11 @@ "issues": "https://github.com/filamentphp/filament/issues", "source": "https://github.com/filamentphp/filament" }, - "time": "2024-03-01T12:23:48+00:00" + "time": "2024-03-04T12:09:37+00:00" }, { "name": "filament/notifications", - "version": "v3.2.42", + "version": "v3.2.44", "source": { "type": "git", "url": "https://github.com/filamentphp/notifications.git", @@ -1627,7 +1627,7 @@ }, { "name": "filament/spatie-laravel-media-library-plugin", - "version": "v3.2.42", + "version": "v3.2.44", "source": { "type": "git", "url": "https://github.com/filamentphp/spatie-laravel-media-library-plugin.git", @@ -1664,7 +1664,7 @@ }, { "name": "filament/spatie-laravel-tags-plugin", - "version": "v3.2.42", + "version": "v3.2.44", "source": { "type": "git", "url": "https://github.com/filamentphp/spatie-laravel-tags-plugin.git", @@ -1701,7 +1701,7 @@ }, { "name": "filament/spatie-laravel-translatable-plugin", - "version": "v3.2.42", + "version": "v3.2.44", "source": { "type": "git", "url": "https://github.com/filamentphp/spatie-laravel-translatable-plugin.git", @@ -1746,16 +1746,16 @@ }, { "name": "filament/support", - "version": "v3.2.42", + "version": "v3.2.44", "source": { "type": "git", "url": "https://github.com/filamentphp/support.git", - "reference": "1a186d3553f07f496522acab111373e2dbfd2b6b" + "reference": "1f5ba74e8755f5a11c0bf53907d8d9ed1f8d868d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filamentphp/support/zipball/1a186d3553f07f496522acab111373e2dbfd2b6b", - "reference": "1a186d3553f07f496522acab111373e2dbfd2b6b", + "url": "https://api.github.com/repos/filamentphp/support/zipball/1f5ba74e8755f5a11c0bf53907d8d9ed1f8d868d", + "reference": "1f5ba74e8755f5a11c0bf53907d8d9ed1f8d868d", "shasum": "" }, "require": { @@ -1799,20 +1799,20 @@ "issues": "https://github.com/filamentphp/filament/issues", "source": "https://github.com/filamentphp/filament" }, - "time": "2024-03-01T12:24:02+00:00" + "time": "2024-03-05T14:33:52+00:00" }, { "name": "filament/tables", - "version": "v3.2.42", + "version": "v3.2.44", "source": { "type": "git", "url": "https://github.com/filamentphp/tables.git", - "reference": "91a0edf1627ff5d7179cfde155a758f08c8aa4f4" + "reference": "cccab09e017f618b7803e93ea3a2e91c999fdf3f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filamentphp/tables/zipball/91a0edf1627ff5d7179cfde155a758f08c8aa4f4", - "reference": "91a0edf1627ff5d7179cfde155a758f08c8aa4f4", + "url": "https://api.github.com/repos/filamentphp/tables/zipball/cccab09e017f618b7803e93ea3a2e91c999fdf3f", + "reference": "cccab09e017f618b7803e93ea3a2e91c999fdf3f", "shasum": "" }, "require": { @@ -1852,20 +1852,20 @@ "issues": "https://github.com/filamentphp/filament/issues", "source": "https://github.com/filamentphp/filament" }, - "time": "2024-03-01T12:24:04+00:00" + "time": "2024-03-05T14:33:51+00:00" }, { "name": "filament/widgets", - "version": "v3.2.42", + "version": "v3.2.44", "source": { "type": "git", "url": "https://github.com/filamentphp/widgets.git", - "reference": "8debb8f9f0f2c3d15a8eb27dbe622def01082536" + "reference": "fe151db7d32f1f85117a5be46b3fedd8ebb6380b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filamentphp/widgets/zipball/8debb8f9f0f2c3d15a8eb27dbe622def01082536", - "reference": "8debb8f9f0f2c3d15a8eb27dbe622def01082536", + "url": "https://api.github.com/repos/filamentphp/widgets/zipball/fe151db7d32f1f85117a5be46b3fedd8ebb6380b", + "reference": "fe151db7d32f1f85117a5be46b3fedd8ebb6380b", "shasum": "" }, "require": { @@ -1896,7 +1896,7 @@ "issues": "https://github.com/filamentphp/filament/issues", "source": "https://github.com/filamentphp/filament" }, - "time": "2024-02-29T12:30:30+00:00" + "time": "2024-03-04T12:10:03+00:00" }, { "name": "fruitcake/php-cors", @@ -2268,16 +2268,16 @@ }, { "name": "laravel/framework", - "version": "v10.46.0", + "version": "v10.47.0", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "5e95946a8283a8d5c015035793f9c61c297e937f" + "reference": "fce29b8de62733cdecbe12e3bae801f83fff2ea4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/5e95946a8283a8d5c015035793f9c61c297e937f", - "reference": "5e95946a8283a8d5c015035793f9c61c297e937f", + "url": "https://api.github.com/repos/laravel/framework/zipball/fce29b8de62733cdecbe12e3bae801f83fff2ea4", + "reference": "fce29b8de62733cdecbe12e3bae801f83fff2ea4", "shasum": "" }, "require": { @@ -2470,7 +2470,7 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2024-02-27T16:46:54+00:00" + "time": "2024-03-05T15:18:36+00:00" }, { "name": "laravel/prompts", @@ -3248,16 +3248,16 @@ }, { "name": "livewire/livewire", - "version": "v3.4.6", + "version": "v3.4.7", "source": { "type": "git", "url": "https://github.com/livewire/livewire.git", - "reference": "7e7d638183b34fb61621455891869f5abfd55a82" + "reference": "05f25dab062cd6a1ec24d8df9e889f890c832cb0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/livewire/livewire/zipball/7e7d638183b34fb61621455891869f5abfd55a82", - "reference": "7e7d638183b34fb61621455891869f5abfd55a82", + "url": "https://api.github.com/repos/livewire/livewire/zipball/05f25dab062cd6a1ec24d8df9e889f890c832cb0", + "reference": "05f25dab062cd6a1ec24d8df9e889f890c832cb0", "shasum": "" }, "require": { @@ -3311,7 +3311,7 @@ "description": "A front-end framework for Laravel.", "support": { "issues": "https://github.com/livewire/livewire/issues", - "source": "https://github.com/livewire/livewire/tree/v3.4.6" + "source": "https://github.com/livewire/livewire/tree/v3.4.7" }, "funding": [ { @@ -3319,7 +3319,7 @@ "type": "github" } ], - "time": "2024-02-20T14:04:25+00:00" + "time": "2024-03-05T15:54:03+00:00" }, { "name": "maennchen/zipstream-php", @@ -4882,16 +4882,16 @@ }, { "name": "spatie/image", - "version": "3.3.7", + "version": "3.4.0", "source": { "type": "git", "url": "https://github.com/spatie/image.git", - "reference": "10b4ffbb373a87ab04091cba03ade773cee4f1cb" + "reference": "d4ca0851e2cb40535331e0057d2bb1fda57d57b7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/image/zipball/10b4ffbb373a87ab04091cba03ade773cee4f1cb", - "reference": "10b4ffbb373a87ab04091cba03ade773cee4f1cb", + "url": "https://api.github.com/repos/spatie/image/zipball/d4ca0851e2cb40535331e0057d2bb1fda57d57b7", + "reference": "d4ca0851e2cb40535331e0057d2bb1fda57d57b7", "shasum": "" }, "require": { @@ -4938,7 +4938,7 @@ "spatie" ], "support": { - "source": "https://github.com/spatie/image/tree/3.3.7" + "source": "https://github.com/spatie/image/tree/3.4.0" }, "funding": [ { @@ -4950,7 +4950,7 @@ "type": "github" } ], - "time": "2024-03-01T09:02:54+00:00" + "time": "2024-03-05T17:21:09+00:00" }, { "name": "spatie/image-optimizer", @@ -5068,16 +5068,16 @@ }, { "name": "spatie/laravel-medialibrary", - "version": "11.4.4", + "version": "11.4.5", "source": { "type": "git", "url": "https://github.com/spatie/laravel-medialibrary.git", - "reference": "bb29cacfe209856db304adc6c5ba8c05ff7a8802" + "reference": "b27eb3f233cf802b1f2620fdfc34b4b13926c6d7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/laravel-medialibrary/zipball/bb29cacfe209856db304adc6c5ba8c05ff7a8802", - "reference": "bb29cacfe209856db304adc6c5ba8c05ff7a8802", + "url": "https://api.github.com/repos/spatie/laravel-medialibrary/zipball/b27eb3f233cf802b1f2620fdfc34b4b13926c6d7", + "reference": "b27eb3f233cf802b1f2620fdfc34b4b13926c6d7", "shasum": "" }, "require": { @@ -5160,7 +5160,7 @@ ], "support": { "issues": "https://github.com/spatie/laravel-medialibrary/issues", - "source": "https://github.com/spatie/laravel-medialibrary/tree/11.4.4" + "source": "https://github.com/spatie/laravel-medialibrary/tree/11.4.5" }, "funding": [ { @@ -5172,7 +5172,7 @@ "type": "github" } ], - "time": "2024-02-22T09:39:31+00:00" + "time": "2024-03-04T09:34:47+00:00" }, { "name": "spatie/laravel-package-tools", @@ -6175,16 +6175,16 @@ }, { "name": "symfony/http-kernel", - "version": "v6.4.4", + "version": "v6.4.5", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "7a186f64a7f02787c04e8476538624d6aa888e42" + "reference": "f6947cb939d8efee137797382cb4db1af653ef75" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/7a186f64a7f02787c04e8476538624d6aa888e42", - "reference": "7a186f64a7f02787c04e8476538624d6aa888e42", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/f6947cb939d8efee137797382cb4db1af653ef75", + "reference": "f6947cb939d8efee137797382cb4db1af653ef75", "shasum": "" }, "require": { @@ -6268,7 +6268,7 @@ "description": "Provides a structured process for converting a Request into a Response", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-kernel/tree/v6.4.4" + "source": "https://github.com/symfony/http-kernel/tree/v6.4.5" }, "funding": [ { @@ -6284,7 +6284,7 @@ "type": "tidelift" } ], - "time": "2024-02-27T06:32:13+00:00" + "time": "2024-03-04T21:00:47+00:00" }, { "name": "symfony/mailer", @@ -7224,16 +7224,16 @@ }, { "name": "symfony/routing", - "version": "v6.4.3", + "version": "v6.4.5", "source": { "type": "git", "url": "https://github.com/symfony/routing.git", - "reference": "3b2957ad54902f0f544df83e3d58b38d7e8e5842" + "reference": "7fe30068e207d9c31c0138501ab40358eb2d49a4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/routing/zipball/3b2957ad54902f0f544df83e3d58b38d7e8e5842", - "reference": "3b2957ad54902f0f544df83e3d58b38d7e8e5842", + "url": "https://api.github.com/repos/symfony/routing/zipball/7fe30068e207d9c31c0138501ab40358eb2d49a4", + "reference": "7fe30068e207d9c31c0138501ab40358eb2d49a4", "shasum": "" }, "require": { @@ -7287,7 +7287,7 @@ "url" ], "support": { - "source": "https://github.com/symfony/routing/tree/v6.4.3" + "source": "https://github.com/symfony/routing/tree/v6.4.5" }, "funding": [ { @@ -7303,7 +7303,7 @@ "type": "tidelift" } ], - "time": "2024-01-30T13:55:02+00:00" + "time": "2024-02-27T12:33:30+00:00" }, { "name": "symfony/service-contracts", @@ -9498,16 +9498,16 @@ }, { "name": "orchestra/workbench", - "version": "v8.2.1", + "version": "v8.3.0", "source": { "type": "git", "url": "https://github.com/orchestral/workbench.git", - "reference": "e8e6e4dcf6fb26ea1924c3581e49aa347691a8ea" + "reference": "1246c7ffd0ab8b1cbf9a9b346a50921dd83bc24b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/orchestral/workbench/zipball/e8e6e4dcf6fb26ea1924c3581e49aa347691a8ea", - "reference": "e8e6e4dcf6fb26ea1924c3581e49aa347691a8ea", + "url": "https://api.github.com/repos/orchestral/workbench/zipball/1246c7ffd0ab8b1cbf9a9b346a50921dd83bc24b", + "reference": "1246c7ffd0ab8b1cbf9a9b346a50921dd83bc24b", "shasum": "" }, "require": { @@ -9516,7 +9516,7 @@ "laravel/framework": "^10.38.1", "laravel/tinker": "^2.8.2", "orchestra/canvas": "^8.11.4", - "orchestra/testbench-core": "^8.17", + "orchestra/testbench-core": "^8.22", "php": "^8.1", "spatie/laravel-ray": "^1.32.4", "symfony/polyfill-php83": "^1.28", @@ -9562,9 +9562,9 @@ ], "support": { "issues": "https://github.com/orchestral/workbench/issues", - "source": "https://github.com/orchestral/workbench/tree/v8.2.1" + "source": "https://github.com/orchestral/workbench/tree/v8.3.0" }, - "time": "2023-12-28T15:15:44+00:00" + "time": "2024-03-03T14:32:38+00:00" }, { "name": "pestphp/pest", @@ -9958,20 +9958,21 @@ }, { "name": "phar-io/manifest", - "version": "2.0.3", + "version": "2.0.4", "source": { "type": "git", "url": "https://github.com/phar-io/manifest.git", - "reference": "97803eca37d319dfa7826cc2437fc020857acb53" + "reference": "54750ef60c58e43759730615a392c31c80e23176" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/manifest/zipball/97803eca37d319dfa7826cc2437fc020857acb53", - "reference": "97803eca37d319dfa7826cc2437fc020857acb53", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/54750ef60c58e43759730615a392c31c80e23176", + "reference": "54750ef60c58e43759730615a392c31c80e23176", "shasum": "" }, "require": { "ext-dom": "*", + "ext-libxml": "*", "ext-phar": "*", "ext-xmlwriter": "*", "phar-io/version": "^3.0.1", @@ -10012,9 +10013,15 @@ "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", "support": { "issues": "https://github.com/phar-io/manifest/issues", - "source": "https://github.com/phar-io/manifest/tree/2.0.3" + "source": "https://github.com/phar-io/manifest/tree/2.0.4" }, - "time": "2021-07-20T11:28:43+00:00" + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2024-03-03T12:33:53+00:00" }, { "name": "phar-io/version", @@ -10578,16 +10585,16 @@ }, { "name": "phpunit/php-code-coverage", - "version": "10.1.11", + "version": "10.1.12", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "78c3b7625965c2513ee96569a4dbb62601784145" + "reference": "842f72662d6b9edda84c4b6f13885fd9cd53dc63" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/78c3b7625965c2513ee96569a4dbb62601784145", - "reference": "78c3b7625965c2513ee96569a4dbb62601784145", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/842f72662d6b9edda84c4b6f13885fd9cd53dc63", + "reference": "842f72662d6b9edda84c4b6f13885fd9cd53dc63", "shasum": "" }, "require": { @@ -10644,7 +10651,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/10.1.11" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/10.1.12" }, "funding": [ { @@ -10652,7 +10659,7 @@ "type": "github" } ], - "time": "2023-12-21T15:38:30+00:00" + "time": "2024-03-02T07:22:05+00:00" }, { "name": "phpunit/php-file-iterator", @@ -11176,16 +11183,16 @@ }, { "name": "rector/rector", - "version": "1.0.1", + "version": "1.0.2", "source": { "type": "git", "url": "https://github.com/rectorphp/rector.git", - "reference": "258b775511e62a7188f8ce114d44acaf244d9a7d" + "reference": "7596fa6da06c6a20c012efe6bb3d9188a9113b11" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/rectorphp/rector/zipball/258b775511e62a7188f8ce114d44acaf244d9a7d", - "reference": "258b775511e62a7188f8ce114d44acaf244d9a7d", + "url": "https://api.github.com/repos/rectorphp/rector/zipball/7596fa6da06c6a20c012efe6bb3d9188a9113b11", + "reference": "7596fa6da06c6a20c012efe6bb3d9188a9113b11", "shasum": "" }, "require": { @@ -11220,7 +11227,7 @@ ], "support": { "issues": "https://github.com/rectorphp/rector/issues", - "source": "https://github.com/rectorphp/rector/tree/1.0.1" + "source": "https://github.com/rectorphp/rector/tree/1.0.2" }, "funding": [ { @@ -11228,20 +11235,20 @@ "type": "github" } ], - "time": "2024-02-16T07:53:23+00:00" + "time": "2024-03-03T12:32:31+00:00" }, { "name": "sebastian/cli-parser", - "version": "2.0.0", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/cli-parser.git", - "reference": "efdc130dbbbb8ef0b545a994fd811725c5282cae" + "reference": "c34583b87e7b7a8055bf6c450c2c77ce32a24084" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/efdc130dbbbb8ef0b545a994fd811725c5282cae", - "reference": "efdc130dbbbb8ef0b545a994fd811725c5282cae", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/c34583b87e7b7a8055bf6c450c2c77ce32a24084", + "reference": "c34583b87e7b7a8055bf6c450c2c77ce32a24084", "shasum": "" }, "require": { @@ -11276,7 +11283,8 @@ "homepage": "https://github.com/sebastianbergmann/cli-parser", "support": { "issues": "https://github.com/sebastianbergmann/cli-parser/issues", - "source": "https://github.com/sebastianbergmann/cli-parser/tree/2.0.0" + "security": "https://github.com/sebastianbergmann/cli-parser/security/policy", + "source": "https://github.com/sebastianbergmann/cli-parser/tree/2.0.1" }, "funding": [ { @@ -11284,7 +11292,7 @@ "type": "github" } ], - "time": "2023-02-03T06:58:15+00:00" + "time": "2024-03-02T07:12:49+00:00" }, { "name": "sebastian/code-unit", @@ -11534,16 +11542,16 @@ }, { "name": "sebastian/diff", - "version": "5.1.0", + "version": "5.1.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "fbf413a49e54f6b9b17e12d900ac7f6101591b7f" + "reference": "c41e007b4b62af48218231d6c2275e4c9b975b2e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/fbf413a49e54f6b9b17e12d900ac7f6101591b7f", - "reference": "fbf413a49e54f6b9b17e12d900ac7f6101591b7f", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/c41e007b4b62af48218231d6c2275e4c9b975b2e", + "reference": "c41e007b4b62af48218231d6c2275e4c9b975b2e", "shasum": "" }, "require": { @@ -11551,7 +11559,7 @@ }, "require-dev": { "phpunit/phpunit": "^10.0", - "symfony/process": "^4.2 || ^5" + "symfony/process": "^6.4" }, "type": "library", "extra": { @@ -11589,7 +11597,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/diff/issues", "security": "https://github.com/sebastianbergmann/diff/security/policy", - "source": "https://github.com/sebastianbergmann/diff/tree/5.1.0" + "source": "https://github.com/sebastianbergmann/diff/tree/5.1.1" }, "funding": [ { @@ -11597,7 +11605,7 @@ "type": "github" } ], - "time": "2023-12-22T10:55:06+00:00" + "time": "2024-03-02T07:15:17+00:00" }, { "name": "sebastian/environment", @@ -11665,16 +11673,16 @@ }, { "name": "sebastian/exporter", - "version": "5.1.1", + "version": "5.1.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "64f51654862e0f5e318db7e9dcc2292c63cdbddc" + "reference": "955288482d97c19a372d3f31006ab3f37da47adf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/64f51654862e0f5e318db7e9dcc2292c63cdbddc", - "reference": "64f51654862e0f5e318db7e9dcc2292c63cdbddc", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/955288482d97c19a372d3f31006ab3f37da47adf", + "reference": "955288482d97c19a372d3f31006ab3f37da47adf", "shasum": "" }, "require": { @@ -11731,7 +11739,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/exporter/issues", "security": "https://github.com/sebastianbergmann/exporter/security/policy", - "source": "https://github.com/sebastianbergmann/exporter/tree/5.1.1" + "source": "https://github.com/sebastianbergmann/exporter/tree/5.1.2" }, "funding": [ { @@ -11739,20 +11747,20 @@ "type": "github" } ], - "time": "2023-09-24T13:22:09+00:00" + "time": "2024-03-02T07:17:12+00:00" }, { "name": "sebastian/global-state", - "version": "6.0.1", + "version": "6.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "7ea9ead78f6d380d2a667864c132c2f7b83055e4" + "reference": "987bafff24ecc4c9ac418cab1145b96dd6e9cbd9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/7ea9ead78f6d380d2a667864c132c2f7b83055e4", - "reference": "7ea9ead78f6d380d2a667864c132c2f7b83055e4", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/987bafff24ecc4c9ac418cab1145b96dd6e9cbd9", + "reference": "987bafff24ecc4c9ac418cab1145b96dd6e9cbd9", "shasum": "" }, "require": { @@ -11786,14 +11794,14 @@ } ], "description": "Snapshotting of global state", - "homepage": "http://www.github.com/sebastianbergmann/global-state", + "homepage": "https://www.github.com/sebastianbergmann/global-state", "keywords": [ "global state" ], "support": { "issues": "https://github.com/sebastianbergmann/global-state/issues", "security": "https://github.com/sebastianbergmann/global-state/security/policy", - "source": "https://github.com/sebastianbergmann/global-state/tree/6.0.1" + "source": "https://github.com/sebastianbergmann/global-state/tree/6.0.2" }, "funding": [ { @@ -11801,7 +11809,7 @@ "type": "github" } ], - "time": "2023-07-19T07:19:23+00:00" + "time": "2024-03-02T07:19:19+00:00" }, { "name": "sebastian/lines-of-code", @@ -12699,16 +12707,16 @@ }, { "name": "theseer/tokenizer", - "version": "1.2.2", + "version": "1.2.3", "source": { "type": "git", "url": "https://github.com/theseer/tokenizer.git", - "reference": "b2ad5003ca10d4ee50a12da31de12a5774ba6b96" + "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/b2ad5003ca10d4ee50a12da31de12a5774ba6b96", - "reference": "b2ad5003ca10d4ee50a12da31de12a5774ba6b96", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", + "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", "shasum": "" }, "require": { @@ -12737,7 +12745,7 @@ "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", "support": { "issues": "https://github.com/theseer/tokenizer/issues", - "source": "https://github.com/theseer/tokenizer/tree/1.2.2" + "source": "https://github.com/theseer/tokenizer/tree/1.2.3" }, "funding": [ { @@ -12745,7 +12753,7 @@ "type": "github" } ], - "time": "2023-11-20T00:12:19+00:00" + "time": "2024-03-03T12:36:25+00:00" }, { "name": "zbateson/mail-mime-parser", diff --git a/src/Classes/RenderNavItem.php b/src/Classes/RenderNavItem.php index 0c156ff..660f143 100644 --- a/src/Classes/RenderNavItem.php +++ b/src/Classes/RenderNavItem.php @@ -11,7 +11,7 @@ public static function render(array $item, string $class = ''): string $color = 'border-b border-b-secondary-500 text-secondary-500'; if ($item['type'] === 'page-link' || $item['type'] === 'page_link') { - $page = SkyPlugin::get()->getModel('Post')::page()->find($item['data']['page_id']) ?? ''; + $page = SkyPlugin::get()->getModel('Post')::page()->whereDate('published_at', '<=', now())->find($item['data']['page_id']) ?? ''; $activeClass = (request()->routeIs('page', $page)) ? $color : 'border-transparent'; return 'page()->count(); + return (string) SkyPlugin::get()->getModel('Post')::page()->count(); } public static function getActions(): array diff --git a/src/Filament/Resources/PostResource.php b/src/Filament/Resources/PostResource.php index 95296ea..adf5a5e 100644 --- a/src/Filament/Resources/PostResource.php +++ b/src/Filament/Resources/PostResource.php @@ -260,7 +260,7 @@ public static function getNavigationLabel(): string public static function getNavigationBadge(): ?string { - return (string) static::getEloquentQuery()->posts()->count(); + return (string) SkyPlugin::get()->getModel('Post')::posts()->count(); } public static function getActions(): array diff --git a/src/Livewire/Page.php b/src/Livewire/Page.php index 2d86e94..c1b69ed 100644 --- a/src/Livewire/Page.php +++ b/src/Livewire/Page.php @@ -11,7 +11,11 @@ class Page extends Component public function mount(string $slug): void { - $this->page = config('zeus-sky.models.Post')::where('slug', $slug)->page()->firstOrFail(); + $this->page = config('zeus-sky.models.Post')::query() + ->page() + ->where('slug', $slug) + ->whereDate('published_at', '<=', now()) + ->firstOrFail(); } public function render(): View diff --git a/src/Livewire/Posts.php b/src/Livewire/Posts.php index df0e2a0..7d5fd21 100644 --- a/src/Livewire/Posts.php +++ b/src/Livewire/Posts.php @@ -22,7 +22,9 @@ public function render(): View ->orderBy('published_at', 'desc') ->get(); - $pages = config('zeus-sky.models.Post')::page() + $pages = config('zeus-sky.models.Post')::query() + ->page() + ->whereDate('published_at', '<=', now()) ->search($search) ->with(['tags', 'author', 'media']) ->forCategory($category) @@ -33,8 +35,10 @@ public function render(): View $pages = $this->highlightSearchResults($pages, $search); $posts = $this->highlightSearchResults($posts, $search); - $recent = config('zeus-sky.models.Post')::posts() + $recent = config('zeus-sky.models.Post')::query() + ->posts() ->published() + ->whereDate('published_at', '<=', now()) ->with(['tags', 'author', 'media']) ->limit(config('zeus-sky.recentPostsLimit')) ->orderBy('published_at', 'desc') diff --git a/src/Models/PostScope.php b/src/Models/PostScope.php index 638e2f6..8b6c552 100644 --- a/src/Models/PostScope.php +++ b/src/Models/PostScope.php @@ -52,8 +52,7 @@ public function scopeRelated(Builder $query, Post $post): Builder */ public function scopePage(Builder $query): Builder { - return $query->where('post_type', 'page') - ->whereDate('published_at', '<=', now()); + return $query->where('post_type', 'page'); } /** @@ -61,8 +60,7 @@ public function scopePage(Builder $query): Builder */ public function scopePosts(Builder $query): Builder { - return $query->where('post_type', 'post') - ->whereDate('published_at', '<=', now()); + return $query->where('post_type', 'post'); } /** diff --git a/src/SkyServiceProvider.php b/src/SkyServiceProvider.php index 16bb8bc..2112dd7 100644 --- a/src/SkyServiceProvider.php +++ b/src/SkyServiceProvider.php @@ -90,7 +90,10 @@ private function bootFilamentNavigation(): void ->label(__('Select Page')) ->searchable() ->options(function () { - return SkyPlugin::get()->getModel('Post')::page()->pluck('title', 'id'); + return SkyPlugin::get()->getModel('Post')::query() + ->page() + ->whereDate('published_at', '<=', now()) + ->pluck('title', 'id'); }), ], 'page_link'