[{"data":1,"prerenderedAt":528},["ShallowReactive",2],{"navigation":3,"\u002Fapi\u002Fcategory":72,"\u002Fapi\u002Fcategory-surround":523},[4,42,55],{"title":5,"path":6,"stem":7,"children":8,"page":41},"Api","\u002Fapi","api",[9,13,17,21,25,29,33,37],{"title":10,"path":11,"stem":12},"Cart API","\u002Fapi\u002Fcart","api\u002Fcart",{"title":14,"path":15,"stem":16},"Category API","\u002Fapi\u002Fcategory","api\u002Fcategory",{"title":18,"path":19,"stem":20},"Checkout API","\u002Fapi\u002Fcheckout","api\u002Fcheckout",{"title":22,"path":23,"stem":24},"Inventory","\u002Fapi\u002Finventory","api\u002Finventory",{"title":26,"path":27,"stem":28},"Order Numbers","\u002Fapi\u002Forder-numbers","api\u002Forder-numbers",{"title":30,"path":31,"stem":32},"Product API","\u002Fapi\u002Fproduct","api\u002Fproduct",{"title":34,"path":35,"stem":36},"Promotions API","\u002Fapi\u002Fpromotions","api\u002Fpromotions",{"title":38,"path":39,"stem":40},"Taxes","\u002Fapi\u002Ftaxes","api\u002Ftaxes",false,{"title":43,"path":44,"stem":45,"children":46,"page":41},"Getting Started","\u002Fgetting-started","getting-started",[47,51],{"title":48,"path":49,"stem":50},"Admin panel","\u002Fgetting-started\u002Fadmin-panel","getting-started\u002Fadmin-panel",{"title":52,"path":53,"stem":54},"Installation","\u002Fgetting-started\u002Finstallation","getting-started\u002Finstallation",{"title":56,"path":57,"stem":58,"children":59,"page":41},"Tasks","\u002Ftasks","tasks",[60,64,68],{"title":61,"path":62,"stem":63},"Building A Navigation","\u002Ftasks\u002Fbuilding-a-navigation","tasks\u002Fbuilding-a-navigation",{"title":65,"path":66,"stem":67},"Product Detail Page","\u002Ftasks\u002Fproduct-detail-page","tasks\u002Fproduct-detail-page",{"title":69,"path":70,"stem":71},"Product Listing Page","\u002Ftasks\u002Fproduct-listing-page","tasks\u002Fproduct-listing-page",{"id":73,"title":14,"body":74,"description":517,"extension":518,"links":519,"meta":520,"navigation":145,"path":15,"seo":521,"stem":16,"__hash__":522},"docs\u002Fapi\u002Fcategory.md",{"type":75,"value":76,"toc":511},"minimark",[77,81,85,90,98,184,188,194,250,253,257,263,316,322,375,381,385,391,444,451,507],[78,79,14],"h1",{"id":80},"category-api",[82,83,84],"p",{},"The category model exposes relationships and query helpers for building\nstorefront navigation and product listing pages.",[86,87,89],"h2",{"id":88},"getting-root-categories","Getting root categories",[82,91,92,93,97],{},"Use ",[94,95,96],"code",{},"root()"," when you want the collection of visible top-level\ncategories.",[99,100,105],"pre",{"className":101,"code":102,"language":103,"meta":104,"style":104},"language-php shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","use Larasell\\Larasell\\Models\\Category;\n\n$categories = Category::query()->root()->get();\n","php","",[94,106,107,140,147],{"__ignoreMap":104},[108,109,112,116,120,124,127,129,132,134,137],"span",{"class":110,"line":111},"line",1,[108,113,115],{"class":114},"sbssI","use",[108,117,119],{"class":118},"sTEyZ"," Larasell",[108,121,123],{"class":122},"sMK4o","\\",[108,125,126],{"class":118},"Larasell",[108,128,123],{"class":122},[108,130,131],{"class":118},"Models",[108,133,123],{"class":122},[108,135,136],{"class":118},"Category",[108,138,139],{"class":122},";\n",[108,141,143],{"class":110,"line":142},2,[108,144,146],{"emptyLinePlaceholder":145},true,"\n",[108,148,150,153,156,159,163,166,170,173,176,178,181],{"class":110,"line":149},3,[108,151,152],{"class":122},"$",[108,154,155],{"class":118},"categories ",[108,157,158],{"class":122},"=",[108,160,162],{"class":161},"sBMFI"," Category",[108,164,165],{"class":122},"::",[108,167,169],{"class":168},"s2Zo4","query",[108,171,172],{"class":122},"()->",[108,174,175],{"class":168},"root",[108,177,172],{"class":122},[108,179,180],{"class":168},"get",[108,182,183],{"class":122},"();\n",[86,185,187],{"id":186},"getting-the-sibling-categories","Getting the sibling categories",[82,189,92,190,193],{},[94,191,192],{},"siblings()"," when you want the visible categories that share the\nsame parent as the current category.",[99,195,197],{"className":101,"code":196,"language":103,"meta":104,"style":104},"use Larasell\\Larasell\\Models\\Category;\n\n$siblings = $category->siblings()->get();\n",[94,198,199,219,223],{"__ignoreMap":104},[108,200,201,203,205,207,209,211,213,215,217],{"class":110,"line":111},[108,202,115],{"class":114},[108,204,119],{"class":118},[108,206,123],{"class":122},[108,208,126],{"class":118},[108,210,123],{"class":122},[108,212,131],{"class":118},[108,214,123],{"class":122},[108,216,136],{"class":118},[108,218,139],{"class":122},[108,220,221],{"class":110,"line":142},[108,222,146],{"emptyLinePlaceholder":145},[108,224,225,227,230,232,235,238,241,244,246,248],{"class":110,"line":149},[108,226,152],{"class":122},[108,228,229],{"class":118},"siblings ",[108,231,158],{"class":122},[108,233,234],{"class":122}," $",[108,236,237],{"class":118},"category",[108,239,240],{"class":122},"->",[108,242,243],{"class":168},"siblings",[108,245,172],{"class":122},[108,247,180],{"class":168},[108,249,183],{"class":122},[82,251,252],{},"The current category is excluded from the result.",[86,254,256],{"id":255},"getting-the-child-categories","Getting the child categories",[82,258,92,259,262],{},[94,260,261],{},"children()"," when you only need the direct child categories.",[99,264,266],{"className":101,"code":265,"language":103,"meta":104,"style":104},"use Larasell\\Larasell\\Models\\Category;\n\n$children = $category->children()->get();\n",[94,267,268,288,292],{"__ignoreMap":104},[108,269,270,272,274,276,278,280,282,284,286],{"class":110,"line":111},[108,271,115],{"class":114},[108,273,119],{"class":118},[108,275,123],{"class":122},[108,277,126],{"class":118},[108,279,123],{"class":122},[108,281,131],{"class":118},[108,283,123],{"class":122},[108,285,136],{"class":118},[108,287,139],{"class":122},[108,289,290],{"class":110,"line":142},[108,291,146],{"emptyLinePlaceholder":145},[108,293,294,296,299,301,303,305,307,310,312,314],{"class":110,"line":149},[108,295,152],{"class":122},[108,297,298],{"class":118},"children ",[108,300,158],{"class":122},[108,302,234],{"class":122},[108,304,237],{"class":118},[108,306,240],{"class":122},[108,308,309],{"class":168},"children",[108,311,172],{"class":122},[108,313,180],{"class":168},[108,315,183],{"class":122},[82,317,92,318,321],{},[94,319,320],{},"descendants()"," when you need the visible category tree below the\ncurrent category.",[99,323,325],{"className":101,"code":324,"language":103,"meta":104,"style":104},"use Larasell\\Larasell\\Models\\Category;\n\n$descendants = $category->descendants()->get();\n",[94,326,327,347,351],{"__ignoreMap":104},[108,328,329,331,333,335,337,339,341,343,345],{"class":110,"line":111},[108,330,115],{"class":114},[108,332,119],{"class":118},[108,334,123],{"class":122},[108,336,126],{"class":118},[108,338,123],{"class":122},[108,340,131],{"class":118},[108,342,123],{"class":122},[108,344,136],{"class":118},[108,346,139],{"class":122},[108,348,349],{"class":110,"line":142},[108,350,146],{"emptyLinePlaceholder":145},[108,352,353,355,358,360,362,364,366,369,371,373],{"class":110,"line":149},[108,354,152],{"class":122},[108,356,357],{"class":118},"descendants ",[108,359,158],{"class":122},[108,361,234],{"class":122},[108,363,237],{"class":118},[108,365,240],{"class":122},[108,367,368],{"class":168},"descendants",[108,370,172],{"class":122},[108,372,180],{"class":168},[108,374,183],{"class":122},[82,376,377,378,380],{},"The ",[94,379,368],{}," relationship recursively eager loads nested children.",[86,382,384],{"id":383},"getting-products-of-a-category","Getting products of a category",[82,386,92,387,390],{},[94,388,389],{},"products()"," to query products attached to the category.",[99,392,394],{"className":101,"code":393,"language":103,"meta":104,"style":104},"use Larasell\\Larasell\\Models\\Category;\n\n$products = $category->products()->get();\n",[94,395,396,416,420],{"__ignoreMap":104},[108,397,398,400,402,404,406,408,410,412,414],{"class":110,"line":111},[108,399,115],{"class":114},[108,401,119],{"class":118},[108,403,123],{"class":122},[108,405,126],{"class":118},[108,407,123],{"class":122},[108,409,131],{"class":118},[108,411,123],{"class":122},[108,413,136],{"class":118},[108,415,139],{"class":122},[108,417,418],{"class":110,"line":142},[108,419,146],{"emptyLinePlaceholder":145},[108,421,422,424,427,429,431,433,435,438,440,442],{"class":110,"line":149},[108,423,152],{"class":122},[108,425,426],{"class":118},"products ",[108,428,158],{"class":122},[108,430,234],{"class":122},[108,432,237],{"class":118},[108,434,240],{"class":122},[108,436,437],{"class":168},"products",[108,439,172],{"class":122},[108,441,180],{"class":168},[108,443,183],{"class":122},[82,445,446,447,450],{},"For storefront pages, filter the products with the ",[94,448,449],{},"visible()"," scope so\ninactive products are not shown.",[99,452,454],{"className":101,"code":453,"language":103,"meta":104,"style":104},"use Larasell\\Larasell\\Models\\Category;\n\n$products = $category->products()->visible()->get();\n",[94,455,456,476,480],{"__ignoreMap":104},[108,457,458,460,462,464,466,468,470,472,474],{"class":110,"line":111},[108,459,115],{"class":114},[108,461,119],{"class":118},[108,463,123],{"class":122},[108,465,126],{"class":118},[108,467,123],{"class":122},[108,469,131],{"class":118},[108,471,123],{"class":122},[108,473,136],{"class":118},[108,475,139],{"class":122},[108,477,478],{"class":110,"line":142},[108,479,146],{"emptyLinePlaceholder":145},[108,481,482,484,486,488,490,492,494,496,498,501,503,505],{"class":110,"line":149},[108,483,152],{"class":122},[108,485,426],{"class":118},[108,487,158],{"class":122},[108,489,234],{"class":122},[108,491,237],{"class":118},[108,493,240],{"class":122},[108,495,437],{"class":168},[108,497,172],{"class":122},[108,499,500],{"class":168},"visible",[108,502,172],{"class":122},[108,504,180],{"class":168},[108,506,183],{"class":122},[508,509,510],"style",{},"html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":104,"searchDepth":111,"depth":142,"links":512},[513,514,515,516],{"id":88,"depth":142,"text":89},{"id":186,"depth":142,"text":187},{"id":255,"depth":142,"text":256},{"id":383,"depth":142,"text":384},"Fetch sibling categories, child categories, descendants, and products from a category.","md",null,{},{"title":14,"description":517},"Ej_YcDsM402zqMTCScMtFcH-Zgeh1j153ixUM-MAnBg",[524,526],{"title":10,"path":11,"stem":12,"description":525,"children":-1},"Create carts, add products, update quantities, and calculate totals.",{"title":18,"path":19,"stem":20,"description":527,"children":-1},"Turn a cart into an immutable order and collect payment.",1789114878354]