Skip to content

Commit

Permalink
Fix unpublished random post card
Browse files Browse the repository at this point in the history
  • Loading branch information
rizalfakhri committed Feb 2, 2021
1 parent e8c87ba commit 2b35dde
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/Services/PostService.php
Original file line number Diff line number Diff line change
Expand Up @@ -445,9 +445,9 @@ public function getByAuthor($id, $limit=5)

public function random()
{
$posts = $this->model()->inRandomOrder()->whereNull('deleted_at')->whereStatus('publish')->whereNull('type')->orWhere('type', 'markdown')->first();
$posts = $this->model()->inRandomOrder()->whereNull('deleted_at')->whereStatus('publish');

return $posts;
return $posts->first();
}

public function loved($take=5)
Expand Down

0 comments on commit 2b35dde

Please sign in to comment.