A
A
Andr Lw12015-12-01 11:56:24
Laravel
Andr Lw1, 2015-12-01 11:56:24

How to display posts that belong to multiple categories in Laravel?

There are tables:
• posts
- id
- title
• categories
- id
- title
• catposts
- id
- category_id
- post_id
How to display all posts from a certain category?
PS if I did not correctly implement the categories + posts, then tell me how to do it right.
Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
D', 2015-12-01
@Denormalization

Um... Documentation is out of fashion already?
laravel.com/docs/5.1/eloquent-relationships#many-t...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question