I have post table and comments table. I want to get all posts with its comments and the following returns just post which has comments:
Post::with('comments')
UPDATE
for example
post_table
id post
1 post1
2 post2
comment table
id post_id comment
1 1 sapmle_comment
Post::with('comments') returns only that posts, which have comments, it returns only first post, becouse second post doesnot have comments, i want to get all post (with or without comments)
Posts
withcomments
! – The AlphaPost::with('comments')->get()
help? – user1669496