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 2b35dde commit 50bcfed
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/Services/PostService.php
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ public function getByAuthor($id, $limit=5)

public function random()
{
$posts = $this->model()->inRandomOrder()->whereNull('deleted_at')->whereStatus('publish');
$posts = $this->model()->withoutTrashed()->inRandomOrder()->where('status', 'publish');

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

0 comments on commit 50bcfed

Please sign in to comment.