Skip to content

Commit 0fdc693

Browse files
committed
fix: support suggestion PostGetNavigateAction
1 parent 25cff98 commit 0fdc693

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/Http/Actions/Post/PostGetNavigateAction.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ public function __invoke(string $slug): BaseHttpResponse|JsonResponse|JsonResour
113113
->setMessage('Not found');
114114
}
115115

116+
/** @var Post|null $currentPost */
116117
$currentPost = Post::query()
117118
->where('id', $slugModel->reference_id)
118119
->where('status', StatusEnum::PUBLISHED)
@@ -127,6 +128,7 @@ public function __invoke(string $slug): BaseHttpResponse|JsonResponse|JsonResour
127128
->setMessage('Not found');
128129
}
129130

131+
// At this point, $currentPost is guaranteed to be a Post instance
130132
// Using service method for complex business logic
131133
$navigationPosts = $this->postService->getNavigationPosts($currentPost);
132134

0 commit comments

Comments
 (0)