daily pastebin goal
59%
SHARE
TWEET

Untitled

a guest Aug 10th, 2018 54 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $posts = post::where('category_id', $id)->paginate(7);
  2.    
  3. public function post()
  4. {
  5.     return $this->hasMany(Post::class, 'parent_id', 'category_id');
  6. }
  7.    
  8. $category = Category::where('parent_id',1)->first();
  9. $post = $category->post;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top