Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
YasserElgammal committed Aug 15, 2023
1 parent 991427b commit 0b6a103
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/Http/Controllers/Front/PostController.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ class PostController extends Controller
public function getPostBySlug($slug)
{
// I've Pass Slug to Get the Category per it's Slug
$post = Post::with(['category', 'user'])->whereStatus(true)->whereSlug($slug)->firstOrFail();
$post = Post::with(['category', 'user', 'comments.user'])
->whereStatus(true)->whereSlug($slug)->firstOrFail();

$comments = $post->comments;
$post_title = $post->title;

Expand Down

0 comments on commit 0b6a103

Please sign in to comment.