I want to establish a relationship between two tables. So I want to bring blogs with status = 1. How can I do that. My categories table looks like
id|category_name|status|
1 |Animals | 0
2 |Education | 1
3 |Water | 0
My blogs table looks like
id|category_id|title | description |
1 | 1 |New Post 1 | Post description 1 |
2 | 2 |New Post 2 | Post description 1 |
3 | 3 |New Post 3 | Post description 1 |
4 | 2 |New Post 4 | Post description 1 |
How do I list blogs provided that where('status', 1) from categories table? Please help me. thanks for your help.