Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

laravel display category post by slug

    public function postCategory($id)
    {
        $posts = Post::where('category_id', $id)->get();

        return view('front.posts.category', compact('posts'));
    }
Source by laracasts.com #
 
PREVIOUS NEXT
Tagged: #laravel #display #category #post #slug
ADD COMMENT
Topic
Name
4+2 =