NadeemAkhter's avatar

Master Page Attributes

I work on e-commerce website ,in my master page layout all categories are shown in header section the issue is i add master page attributes in all routes . is their any way i add these attributes any where else only one time not for all routes.

//////////////////////Header//////////////////////////////////////
       
        $all_categories= Category::where('published',1)->get();
        $nav_categories=Category::with('sub_category','ribbon')->where([['published',1],['shown_nav',1],['parent_id',null]])->get();
      ////////////////////////////////\\ 

these lines of code used in every action

0 likes
2 replies

Please or to participate in this conversation.