public function recentBlogPosts($numPosts = 4)
    {
        $posts = BlogPost::where([
            ['status', '=', 'PUBLISHED'],
        ])->whereDate('published_date', '<=', Carbon::now())
            ->limit($numPosts)
            ->orderBy('created_at', 'desc')
            ->get();

        return view("{$this->viewPath}::modules/posts/posts-grid", [
            'posts' => $posts,
        ]);
    }
public function recentBlogPosts($numPosts = 4)
    {
        $posts = BlogPost::where([
            ['status', '=', 'PUBLISHED'],
        ])->whereDate('published_date', '<=', Carbon::now())
            ->limit($numPosts)
            ->orderBy('created_at', 'desc')
            ->get();

        return view("{$this->viewPath}::modules/posts/posts-grid", [
            'posts' => $posts,
        ]);
    }
public function recentBlogPosts ( $ numPosts = 4 ) { $ posts = BlogPost :: where ( [ [ 'status' , '=' , 'PUBLISHED' ] , ] ) -> whereDate ( 'published_date' , '<=' , Carbon :: now ( ) ) -> limit ( $ numPosts ) -> orderBy ( 'created_at' , 'desc' ) -> get ( ) ; return view ( "{$this->viewPath}::modules/posts/posts-grid" , [ 'posts' => $ posts , ] ) ; }
Recent posts widget

@return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
Recent posts widget