From ac1181d519a2a15c7dfa02e942b10e7fe176e518 Mon Sep 17 00:00:00 2001 From: Kurt Friars Date: Mon, 13 Jan 2025 15:19:32 -0500 Subject: [PATCH 1/2] Allow the workflow cast to be customized --- src/Concerns/IsPublishable.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Concerns/IsPublishable.php b/src/Concerns/IsPublishable.php index a024d65..34f1470 100644 --- a/src/Concerns/IsPublishable.php +++ b/src/Concerns/IsPublishable.php @@ -39,7 +39,7 @@ public function initializeIsPublishable() protected function mergePublishableCasts(): void { $this->mergeCasts([ - $this->workflowColumn() => Status::class, + $this->workflowColumn() => config()->get('publisher.workflow'), $this->draftColumn() => 'json', $this->hasBeenPublishedColumn() => 'boolean', $this->shouldDeleteColumn() => 'boolean', From f6152e1dd07dff9f4f736f2edd2c9d859c5fcc05 Mon Sep 17 00:00:00 2001 From: kfriars <3378675+kfriars@users.noreply.github.com> Date: Mon, 13 Jan 2025 20:20:04 +0000 Subject: [PATCH 2/2] Fix styling --- src/Concerns/IsPublishable.php | 1 - tests/Feature/DraftPathsTest.php | 4 ++-- tests/Feature/InstallationTest.php | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Concerns/IsPublishable.php b/src/Concerns/IsPublishable.php index 34f1470..8a39a8a 100644 --- a/src/Concerns/IsPublishable.php +++ b/src/Concerns/IsPublishable.php @@ -6,7 +6,6 @@ use Plank\Publisher\Builders\PublisherBuilder; use Plank\Publisher\Contracts\Publishable; use Plank\Publisher\Contracts\PublishingStatus; -use Plank\Publisher\Enums\Status; use Plank\Publisher\Facades\Publisher; use Plank\Publisher\Scopes\PublisherScope; diff --git a/tests/Feature/DraftPathsTest.php b/tests/Feature/DraftPathsTest.php index 961e86f..754e8bf 100644 --- a/tests/Feature/DraftPathsTest.php +++ b/tests/Feature/DraftPathsTest.php @@ -3,8 +3,8 @@ use function Pest\Laravel\get; it('correctly forces draft content on the configured draft_paths', function () { - get('pages/1')->assertSee('Draft Content Restricted'); +get('pages/1')->assertSee('Draft Content Restricted'); get('admin')->assertSee('Draft Content Visible'); get('admin/dashboard')->assertSee('Draft Content Visible'); get('admin/resources/pages/1/details')->assertSee('Draft Content Visible'); -}); + }); diff --git a/tests/Feature/InstallationTest.php b/tests/Feature/InstallationTest.php index fa176ec..ca070a2 100644 --- a/tests/Feature/InstallationTest.php +++ b/tests/Feature/InstallationTest.php @@ -51,7 +51,7 @@ it('publishes the migrations file when confirmed', function () { Publisher::shouldReceive('publishableModels') - ->andReturn(collect([new Post()])); + ->andReturn(collect([new Post])); artisan('publisher:install') ->expectsConfirmation('⚠️ Please ensure you have added the \Plank\Publisher\Contracts\Publishable interface to the models you wish to be publishable. Continue?', 'yes')