33namespace CSlant \Blog \Api \Services ;
44
55use CSlant \Blog \Api \Supports \Queries \QueryPost ;
6- use CSlant \Blog \Core \Enums \StatusEnum ;
7- use CSlant \Blog \Core \Facades \Base \SlugHelper ;
86use CSlant \Blog \Core \Http \Responses \Base \BaseHttpResponse ;
97use CSlant \Blog \Core \Models \Post ;
10- use CSlant \Blog \Core \Models \Slug ;
118use Illuminate \Contracts \Pagination \LengthAwarePaginator ;
129use Illuminate \Support \Arr ;
1310
@@ -63,7 +60,7 @@ public function getNavigationPosts(Post $currentPost): array
6360
6461 // Get previous post
6562 $ previous = $ this ->getSingleNavigationPost ($ currentPost ->id , $ categoryIds , $ tagIds );
66-
63+
6764 // Get next post (exclude the previous post if found)
6865 $ excludeIds = [$ currentPost ->id ];
6966 if ($ previous ) {
@@ -84,7 +81,7 @@ public function getNavigationPosts(Post $currentPost): array
8481 * @param \Illuminate\Support\Collection $categoryIds
8582 * @param \Illuminate\Support\Collection $tagIds
8683 * @param array $excludeIds
87- * @return Post| null
84+ * @return null|Post
8885 */
8986 private function getSingleNavigationPost (int $ currentPostId , $ categoryIds , $ tagIds , array $ excludeIds = []): ?Post
9087 {
@@ -103,7 +100,7 @@ private function getSingleNavigationPost(int $currentPostId, $categoryIds, $tagI
103100 ->with (['slugable ' , 'categories ' , 'tags ' , 'author ' ])
104101 ->inRandomOrder ()
105102 ->first ();
106-
103+
107104 if ($ post ) {
108105 return $ post ;
109106 }
@@ -120,7 +117,7 @@ private function getSingleNavigationPost(int $currentPostId, $categoryIds, $tagI
120117 ->with (['slugable ' , 'categories ' , 'tags ' , 'author ' ])
121118 ->inRandomOrder ()
122119 ->first ();
123-
120+
124121 if ($ post ) {
125122 return $ post ;
126123 }
0 commit comments