toArray(); $blog_categ = blog_category::latest()->limit(2)->get()->toArray(); $blogs = blog::latest()->get()->toArray(); // dd($blog_categ); return view('Frontend.Pages.Latest_news.latest_news')->with(['blog'=>$blogs,'blog_categs'=>$blog_categ]); } public function blog_detail($id) { $blog_three = blog::latest()->limit(3)->get(); $blog = blog::find($id)->toArray(); $blog_categ = blog_category::all()->toArray(); return view('Frontend.Pages.Latest_news.latest_news_detail')->with(['blog'=>$blog,'blog_categs'=>$blog_categ,'latest_blog'=>$blog_three]); } public function index_categ($id) { $categ_with_blog = blog_category::with('blog') ->where('id',$id) ->get() ->toArray(); // echo "
"; print_r($categ_with_blog);exit;
        return view('Frontend.Pages.Latest_news.latest_news_categ')->with(['categ_blog'=>$categ_with_blog]);
    }
    
    
}