diff --git a/app/Services/PostService.php b/app/Services/PostService.php index 597685b..d44c99a 100644 --- a/app/Services/PostService.php +++ b/app/Services/PostService.php @@ -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(); }