[{"data":1,"prerenderedAt":682},["ShallowReactive",2],{"navigation":3,"\u002Fgetting-started\u002Fquick-start":193,"\u002Fgetting-started\u002Fquick-start-surround":677},[4,27,49,99,149,169,183],{"title":5,"icon":6,"path":7,"stem":8,"children":9,"page":26},"Getting Started","i-lucide-rocket","\u002Fgetting-started","1.getting-started",[10,14,18,22],{"title":11,"path":12,"stem":13},"Introduction","\u002Fgetting-started\u002Fintroduction","1.getting-started\u002F1.introduction",{"title":15,"path":16,"stem":17},"Installation","\u002Fgetting-started\u002Finstallation","1.getting-started\u002F2.installation",{"title":19,"path":20,"stem":21},"Quick Start","\u002Fgetting-started\u002Fquick-start","1.getting-started\u002F3.quick-start",{"title":23,"path":24,"stem":25},"Existing Application","\u002Fgetting-started\u002Fexisting-application","1.getting-started\u002F4.existing-application",false,{"title":28,"icon":29,"path":30,"stem":31,"children":32,"page":26},"Concepts","i-lucide-layers","\u002Fconcepts","2.concepts",[33,37,41,45],{"title":34,"path":35,"stem":36},"Layers","\u002Fconcepts\u002Flayers","2.concepts\u002F1.layers",{"title":38,"path":39,"stem":40},"Buckets","\u002Fconcepts\u002Fbuckets","2.concepts\u002F2.buckets",{"title":42,"path":43,"stem":44},"Boundaries","\u002Fconcepts\u002Fboundaries","2.concepts\u002F3.boundaries",{"title":46,"path":47,"stem":48},"Service Providers","\u002Fconcepts\u002Fservice-providers","2.concepts\u002F4.service-providers",{"title":50,"icon":51,"path":52,"stem":53,"children":54,"page":26},"Guides","i-lucide-book-marked","\u002Fguides","3.guides",[55,59,63,67,71,75,79,83,87,91,95],{"title":56,"path":57,"stem":58},"Add a Domain","\u002Fguides\u002Fadd-a-domain","3.guides\u002F01.add-a-domain",{"title":60,"path":61,"stem":62},"Share Code Between Layers","\u002Fguides\u002Fshare-code-between-layers","3.guides\u002F02.share-code-between-layers",{"title":64,"path":65,"stem":66},"Routes","\u002Fguides\u002Froutes","3.guides\u002F03.routes",{"title":68,"path":69,"stem":70},"Views and Components","\u002Fguides\u002Fviews-and-components","3.guides\u002F04.views-and-components",{"title":72,"path":73,"stem":74},"Seeders","\u002Fguides\u002Fseeders","3.guides\u002F05.seeders",{"title":76,"path":77,"stem":78},"Configuration","\u002Fguides\u002Fconfiguration","3.guides\u002F06.configuration",{"title":80,"path":81,"stem":82},"Events","\u002Fguides\u002Fevents","3.guides\u002F07.events",{"title":84,"path":85,"stem":86},"Tests and CI","\u002Fguides\u002Ftesting-and-ci","3.guides\u002F08.testing-and-ci",{"title":88,"path":89,"stem":90},"Production","\u002Fguides\u002Fproduction","3.guides\u002F09.production",{"title":92,"path":93,"stem":94},"Remove a Layer","\u002Fguides\u002Fremoving-a-layer","3.guides\u002F10.removing-a-layer",{"title":96,"path":97,"stem":98},"Multi-tenancy","\u002Fguides\u002Fmulti-tenancy","3.guides\u002F11.multi-tenancy",{"title":100,"icon":101,"path":102,"stem":103,"children":104,"page":26},"Commands","i-lucide-terminal","\u002Fcommands","4.commands",[105,109,113,117,121,125,129,133,137,141,145],{"title":106,"path":107,"stem":108},"Overview","\u002Fcommands\u002Foverview","4.commands\u002F01.overview",{"title":110,"path":111,"stem":112},"osdd:start","\u002Fcommands\u002Fosdd-start","4.commands\u002F02.osdd-start",{"title":114,"path":115,"stem":116},"osdd:layer","\u002Fcommands\u002Fosdd-layer","4.commands\u002F03.osdd-layer",{"title":118,"path":119,"stem":120},"osdd:list","\u002Fcommands\u002Fosdd-list","4.commands\u002F04.osdd-list",{"title":122,"path":123,"stem":124},"osdd:check","\u002Fcommands\u002Fosdd-check","4.commands\u002F05.osdd-check",{"title":126,"path":127,"stem":128},"osdd:graph","\u002Fcommands\u002Fosdd-graph","4.commands\u002F06.osdd-graph",{"title":130,"path":131,"stem":132},"osdd:seed","\u002Fcommands\u002Fosdd-seed","4.commands\u002F07.osdd-seed",{"title":134,"path":135,"stem":136},"osdd:phpunit","\u002Fcommands\u002Fosdd-phpunit","4.commands\u002F08.osdd-phpunit",{"title":138,"path":139,"stem":140},"osdd:remove","\u002Fcommands\u002Fosdd-remove","4.commands\u002F09.osdd-remove",{"title":142,"path":143,"stem":144},"osdd:cache","\u002Fcommands\u002Fosdd-cache","4.commands\u002F10.osdd-cache",{"title":146,"path":147,"stem":148},"Generators","\u002Fcommands\u002Fmake-commands","4.commands\u002F11.make-commands",{"title":150,"icon":151,"path":152,"stem":153,"children":154,"page":26},"API Reference","i-lucide-book-open","\u002Fapi-reference","5.api-reference",[155,159,162,166],{"title":156,"path":157,"stem":158},"LayerServiceProvider","\u002Fapi-reference\u002Flayer-service-provider","5.api-reference\u002F1.layer-service-provider",{"title":34,"path":160,"stem":161},"\u002Fapi-reference\u002Flayers","5.api-reference\u002F2.layers",{"title":163,"path":164,"stem":165},"SeederRegistry","\u002Fapi-reference\u002Fseeder-registry","5.api-reference\u002F3.seeder-registry",{"title":76,"path":167,"stem":168},"\u002Fapi-reference\u002Fconfiguration","5.api-reference\u002F4.configuration",{"title":170,"icon":171,"path":172,"stem":173,"children":174,"page":26},"Integrations","i-lucide-puzzle","\u002Fintegrations","6.integrations",[175,179],{"title":176,"path":177,"stem":178},"Laravel Boost","\u002Fintegrations\u002Flaravel-boost","6.integrations\u002F1.laravel-boost",{"title":180,"path":181,"stem":182},"Tinker and IDE Helper","\u002Fintegrations\u002Ftinker-and-ide-helper","6.integrations\u002F2.tinker-and-ide-helper",{"title":184,"icon":185,"path":186,"stem":187,"children":188,"page":26},"Upgrade","i-lucide-arrow-up-circle","\u002Fupgrade","7.upgrade",[189],{"title":190,"path":191,"stem":192},"Upgrade from 2.x","\u002Fupgrade\u002Ffrom-2x","7.upgrade\u002F1.from-2x",{"id":194,"title":19,"body":195,"description":669,"extension":670,"links":671,"meta":672,"navigation":673,"path":20,"seo":674,"sitemap":675,"stem":21,"__hash__":676},"docs\u002F1.getting-started\u002F3.quick-start.md",{"type":196,"value":197,"toc":666},"minimark",[198,207,635,640,662],[199,200,201,202,206],"p",{},"This guide starts from a fresh Laravel project. On an application with code to keep, read ",[203,204,205],"a",{"href":24},"Existing application"," instead.",[208,209,211,216,265,269,285,288,356,364,367,381,396,400,414,439,445,448,471,475,490,510,526,530,582,586,593,612,615,629],"steps",{"level":210},"3",[212,213,215],"h3",{"id":214},"create-the-project","Create the project",[217,218,223],"pre",{"className":219,"code":220,"language":221,"meta":222,"style":222},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","composer create-project laravel\u002Flaravel my-app\ncd my-app\ncomposer require lomkit\u002Flaravel-osdd\n","bash","",[224,225,226,245,254],"code",{"__ignoreMap":222},[227,228,231,235,239,242],"span",{"class":229,"line":230},"line",1,[227,232,234],{"class":233},"sBMFI","composer",[227,236,238],{"class":237},"sfazB"," create-project",[227,240,241],{"class":237}," laravel\u002Flaravel",[227,243,244],{"class":237}," my-app\n",[227,246,248,252],{"class":229,"line":247},2,[227,249,251],{"class":250},"s2Zo4","cd",[227,253,244],{"class":237},[227,255,257,259,262],{"class":229,"line":256},3,[227,258,234],{"class":233},[227,260,261],{"class":237}," require",[227,263,264],{"class":237}," lomkit\u002Flaravel-osdd\n",[212,266,268],{"id":267},"convert-it-to-layers","Convert it to layers",[217,270,272],{"className":219,"code":271,"language":221,"meta":222,"style":222},"php artisan osdd:start\n",[224,273,274],{"__ignoreMap":222},[227,275,276,279,282],{"class":229,"line":230},[227,277,278],{"class":233},"php",[227,280,281],{"class":237}," artisan",[227,283,284],{"class":237}," osdd:start\n",[199,286,287],{},"The command asks for confirmation, then:",[289,290,291,303,317,331,349],"ol",{},[292,293,294,295,298,299,302],"li",{},"creates the ",[224,296,297],{},"functional\u002Fusers"," layer: the ",[224,300,301],{},"User"," model, its factory, seeder and migration, and a provider that points Laravel's auth to that model;",[292,304,294,305,308,309,312,313,316],{},[224,306,307],{},"technical\u002Fosdd"," layer: the OSDD configuration, the cache and jobs migrations, and ",[224,310,311],{},"LayersSeeder"," as the default seeder of ",[224,314,315],{},"db:seed",";",[292,318,319,320,323,324,327,328,316],{},"registers both layers in the root ",[224,321,322],{},"composer.json"," and removes the ",[224,325,326],{},"App\\Providers\\..."," entries from ",[224,329,330],{},"bootstrap\u002Fproviders.php",[292,332,333,334,337,338,341,342,345,346,316],{},"deletes ",[224,335,336],{},"app\u002F"," and ",[224,339,340],{},"config\u002F",", empties ",[224,343,344],{},"database\u002F"," except ",[224,347,348],{},"database\u002Fdatabase.sqlite",[292,350,351,352,355],{},"asks to run ",[224,353,354],{},"composer update functional\u002Fusers technical\u002Fosdd",".",[217,357,362],{"className":358,"code":360,"language":361},[359],"language-text","functional\u002F\n  users\u002F\n    composer.json\n    src\u002FModels\u002FUser.php\n    src\u002FProviders\u002FUsersServiceProvider.php\n    database\u002Ffactories\u002FUserFactory.php\n    database\u002Fmigrations\u002F0001_01_01_000000_create_users_table.php\n    database\u002Fseeders\u002FUsersSeeder.php\ntechnical\u002F\n  osdd\u002F\n    composer.json\n    config\u002Fosdd.php\n    database\u002Fmigrations\u002F\n    src\u002FProviders\u002FOsddServiceProvider.php\ndatabase\u002F\n  database.sqlite\n","text",[224,363,360],{"__ignoreMap":222},[199,365,366],{},"Create the tables:",[217,368,370],{"className":219,"code":369,"language":221,"meta":222,"style":222},"php artisan migrate\n",[224,371,372],{"__ignoreMap":222},[227,373,374,376,378],{"class":229,"line":230},[227,375,278],{"class":233},[227,377,281],{"class":237},[227,379,380],{"class":237}," migrate\n",[382,383,384],"tip",{},[199,385,386,387,390,391,395],{},"In a script or a CI job: ",[224,388,389],{},"php artisan osdd:start --force --composer-update",". See ",[203,392,393],{"href":111},[224,394,110],{}," for every detail.",[212,397,399],{"id":398},"create-your-first-layer","Create your first layer",[217,401,403],{"className":219,"code":402,"language":221,"meta":222,"style":222},"php artisan osdd:layer\n",[224,404,405],{"__ignoreMap":222},[227,406,407,409,411],{"class":229,"line":230},[227,408,278],{"class":233},[227,410,281],{"class":237},[227,412,413],{"class":237}," osdd:layer\n",[199,415,416,417,420,421,424,425,428,429,432,433,435,436,355],{},"The command asks where to create the layer (",[224,418,419],{},"functional"," or ",[224,422,423],{},"technical","), its name (",[224,426,427],{},"orders",") and which files to generate. The default selection creates a migration, a model, a factory, a service provider and a test. Then it registers ",[224,430,431],{},"functional\u002Forders"," in the root ",[224,434,322],{}," and offers to run ",[224,437,438],{},"composer update functional\u002Forders",[217,440,443],{"className":441,"code":442,"language":361},[359],"functional\u002Forders\u002F\n├── composer.json\n├── src\u002F\n│   ├── Models\u002FOrder.php\n│   └── Providers\u002FOrdersServiceProvider.php\n├── database\u002F\n│   ├── factories\u002FOrderFactory.php\n│   └── migrations\u002Fxxxx_xx_xx_xxxxxx_create_orders_table.php\n└── tests\u002F\n    └── Feature\u002FOrdersTest.php\n",[224,444,442],{"__ignoreMap":222},[199,446,447],{},"Without a terminal, name the layer and pick the generators:",[217,449,451],{"className":219,"code":450,"language":221,"meta":222,"style":222},"php artisan osdd:layer functional\u002Forders --generators=migration,model,factory,provider,test --composer-update\n",[224,452,453],{"__ignoreMap":222},[227,454,455,457,459,462,465,468],{"class":229,"line":230},[227,456,278],{"class":233},[227,458,281],{"class":237},[227,460,461],{"class":237}," osdd:layer",[227,463,464],{"class":237}," functional\u002Forders",[227,466,467],{"class":237}," --generators=migration,model,factory,provider,test",[227,469,470],{"class":237}," --composer-update\n",[212,472,474],{"id":473},"generate-code-inside-it","Generate code inside it",[199,476,477,478,481,482,485,486,489],{},"Every ",[224,479,480],{},"make:*"," command has an ",[224,483,484],{},"osdd:*"," twin that takes a ",[224,487,488],{},"--layer"," option:",[217,491,493],{"className":219,"code":492,"language":221,"meta":222,"style":222},"php artisan osdd:controller OrderController --layer=functional\u002Forders\n",[224,494,495],{"__ignoreMap":222},[227,496,497,499,501,504,507],{"class":229,"line":230},[227,498,278],{"class":233},[227,500,281],{"class":237},[227,502,503],{"class":237}," osdd:controller",[227,505,506],{"class":237}," OrderController",[227,508,509],{"class":237}," --layer=functional\u002Forders\n",[199,511,512,513,516,517,519,520,523,524,355],{},"The controller lands in ",[224,514,515],{},"functional\u002Forders\u002Fsrc\u002FHttp\u002FControllers",", not in ",[224,518,336],{},". ",[224,521,522],{},"--layer=orders"," works too while no other layer is named ",[224,525,427],{},[212,527,529],{"id":528},"run-it","Run it",[217,531,533],{"className":219,"code":532,"language":221,"meta":222,"style":222},"php artisan migrate        # every layer's migrations\nphp artisan osdd:seed      # every layer's seeders\nphp artisan osdd:phpunit   # one test suite per layer in phpunit.xml\nphp artisan test\n",[224,534,535,548,560,572],{"__ignoreMap":222},[227,536,537,539,541,544],{"class":229,"line":230},[227,538,278],{"class":233},[227,540,281],{"class":237},[227,542,543],{"class":237}," migrate",[227,545,547],{"class":546},"sHwdD","        # every layer's migrations\n",[227,549,550,552,554,557],{"class":229,"line":247},[227,551,278],{"class":233},[227,553,281],{"class":237},[227,555,556],{"class":237}," osdd:seed",[227,558,559],{"class":546},"      # every layer's seeders\n",[227,561,562,564,566,569],{"class":229,"line":256},[227,563,278],{"class":233},[227,565,281],{"class":237},[227,567,568],{"class":237}," osdd:phpunit",[227,570,571],{"class":546},"   # one test suite per layer in phpunit.xml\n",[227,573,575,577,579],{"class":229,"line":574},4,[227,576,278],{"class":233},[227,578,281],{"class":237},[227,580,581],{"class":237}," test\n",[212,583,585],{"id":584},"keep-the-boundaries","Keep the boundaries",[199,587,588,589,592],{},"A layer declares the layers it uses. For a new layer, pass ",[224,590,591],{},"--requires",":",[217,594,596],{"className":219,"code":595,"language":221,"meta":222,"style":222},"php artisan osdd:layer functional\u002Finvoices --requires=functional\u002Forders\n",[224,597,598],{"__ignoreMap":222},[227,599,600,602,604,606,609],{"class":229,"line":230},[227,601,278],{"class":233},[227,603,281],{"class":237},[227,605,461],{"class":237},[227,607,608],{"class":237}," functional\u002Finvoices",[227,610,611],{"class":237}," --requires=functional\u002Forders\n",[199,613,614],{},"Then check that every layer only uses the layers it requires:",[217,616,618],{"className":219,"code":617,"language":221,"meta":222,"style":222},"php artisan osdd:check\n",[224,619,620],{"__ignoreMap":222},[227,621,622,624,626],{"class":229,"line":230},[227,623,278],{"class":233},[227,625,281],{"class":237},[227,627,628],{"class":237}," osdd:check\n",[217,630,633],{"className":631,"code":632,"language":361},[359],"  ERROR  functional\u002Forders uses functional\u002Fbilling but does not require it.\n\n  functional\u002Forders\u002Fsrc\u002FCheckout.php:7 ............ Functional\\Billing\\Models\\Invoice\n",[224,634,632],{"__ignoreMap":222},[636,637,639],"h2",{"id":638},"next-steps","Next steps",[641,642,643,648,654],"ul",{},[292,644,645,647],{},[203,646,34],{"href":35}," explains what makes a folder a layer.",[292,649,650,653],{},[203,651,652],{"href":57},"Add a domain"," takes a layer from empty to a tested CRUD resource.",[292,655,656,658,659,661],{},[203,657,84],{"href":85}," runs ",[224,660,122],{}," on every pull request.",[663,664,665],"style",{},"html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}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);}html pre.shiki code .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}",{"title":222,"searchDepth":230,"depth":247,"links":667},[668],{"id":638,"depth":247,"text":639},"Convert a fresh Laravel project to layers, create your first layer and check its boundaries, in five minutes.","md",null,{},true,{"title":19,"description":669},{"loc":20},"tFHBM95hQXQhBWhNjC1k0DGy3an1P9AEetDZJR5Bkls",[678,680],{"title":15,"path":16,"stem":17,"description":679,"children":-1},"Install Laravel OSDD and pick your path, fresh project or existing application.",{"title":23,"path":24,"stem":25,"description":681,"children":-1},"Add layers to an application that keeps its app\u002F folder, and move domains into them one at a time.",1794437209293]