[{"data":1,"prerenderedAt":2015},["ShallowReactive",2],{"navigation":3,"\u002Fcommands\u002Fmake-commands":193,"\u002Fcommands\u002Fmake-commands-surround":2010},[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":146,"body":195,"description":2003,"extension":2004,"links":2005,"meta":2006,"navigation":1891,"path":147,"seo":2007,"sitemap":2008,"stem":148,"__hash__":2009},"docs\u002F4.commands\u002F11.make-commands.md",{"type":196,"value":197,"toc":1984},"minimark",[198,211,249,254,264,296,382,388,392,413,976,994,998,1001,1125,1150,1158,1161,1195,1204,1210,1214,1219,1228,1264,1270,1276,1350,1368,1389,1393,1420,1424,1452,1469,1492,1496,1519,1531,1535,1571,1592,1595,1619,1630,1634,1667,1680,1684,1708,1712,1736,1750,1754,1778,1782,1805,1836,1848,1852,1957,1967,1980],[199,200,201,202,206,207,210],"p",{},"Every ",[203,204,205],"code",{},"make:*"," generator of Laravel has an ",[203,208,209],{},"osdd:*"," twin that takes the same arguments and options. The difference: the file lands inside a layer, under the layer's namespace, and the layer provider is updated when the file needs it.",[212,213,218],"pre",{"className":214,"code":215,"language":216,"meta":217,"style":217},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","php artisan osdd:model Order --layer=functional\u002Forders\n# functional\u002Forders\u002Fsrc\u002FModels\u002FOrder.php\n","bash","",[203,219,220,242],{"__ignoreMap":217},[221,222,225,229,233,236,239],"span",{"class":223,"line":224},"line",1,[221,226,228],{"class":227},"sBMFI","php",[221,230,232],{"class":231},"sfazB"," artisan",[221,234,235],{"class":231}," osdd:model",[221,237,238],{"class":231}," Order",[221,240,241],{"class":231}," --layer=functional\u002Forders\n",[221,243,245],{"class":223,"line":244},2,[221,246,248],{"class":247},"sHwdD","# functional\u002Forders\u002Fsrc\u002FModels\u002FOrder.php\n",[250,251,253],"h2",{"id":252},"the-layer-option","The --layer option",[199,255,256,259,260,263],{},[203,257,258],{},"--layer"," takes the layer's name, as written in its ",[203,261,262],{},"composer.json",", or its package name alone when no other layer has it:",[212,265,267],{"className":214,"code":266,"language":216,"meta":217,"style":217},"php artisan osdd:controller OrderController --layer=functional\u002Forders\nphp artisan osdd:controller OrderController --layer=orders\n",[203,268,269,283],{"__ignoreMap":217},[221,270,271,273,275,278,281],{"class":223,"line":224},[221,272,228],{"class":227},[221,274,232],{"class":231},[221,276,277],{"class":231}," osdd:controller",[221,279,280],{"class":231}," OrderController",[221,282,241],{"class":231},[221,284,285,287,289,291,293],{"class":223,"line":244},[221,286,228],{"class":227},[221,288,232],{"class":231},[221,290,277],{"class":231},[221,292,280],{"class":231},[221,294,295],{"class":231}," --layer=orders\n",[297,298,299,312],"table",{},[300,301,302],"thead",{},[303,304,305,309],"tr",{},[306,307,308],"th",{},"Case",[306,310,311],{},"Result",[313,314,315,326,340,351,361,369],"tbody",{},[303,316,317,321],{},[318,319,320],"td",{},"Full name",[318,322,323],{},[203,324,325],{},"--layer=functional\u002Forders",[303,327,328,331],{},[318,329,330],{},"Package name, unique",[318,332,333,336,337],{},[203,334,335],{},"--layer=orders"," finds ",[203,338,339],{},"functional\u002Forders",[303,341,342,345],{},[318,343,344],{},"Package name shared by two layers",[318,346,347,348],{},"Exit 1: ",[203,349,350],{},"Layer [orders] is ambiguous: it matches functional\u002Forders, technical\u002Forders. Pass the full layer name.",[303,352,353,356],{},[318,354,355],{},"Unknown name",[318,357,347,358],{},[203,359,360],{},"Layer [functional\u002Foders] not found. Available layers: functional\u002Forders, functional\u002Fusers. Did you mean [functional\u002Forders]?",[303,362,363,366],{},[318,364,365],{},"Omitted, in a terminal",[318,367,368],{},"The command asks you to search and pick a layer",[303,370,371,377],{},[318,372,373,374],{},"Omitted, without a terminal or with ",[203,375,376],{},"-n",[318,378,347,379],{},[203,380,381],{},"The --layer option is required when the command is not interactive. Available layers: functional\u002Forders, functional\u002Fusers.",[199,383,384,385,387],{},"The error is printed once and nothing is written. Always pass ",[203,386,258],{}," in scripts, CI and when a coding agent runs the command.",[250,389,391],{"id":390},"where-files-go","Where files go",[199,393,394,395,398,399,402,403,405,406,408,409,412],{},"Classes go under the layer's source directory: the directory of its shortest ",[203,396,397],{},"psr-4"," prefix, ",[203,400,401],{},"src\u002F"," for a layer created by ",[203,404,114],{},". For the layer ",[203,407,339],{},", namespace ",[203,410,411],{},"Functional\\Orders",":",[297,414,415,428],{},[300,416,417],{},[303,418,419,422,425],{},[306,420,421],{},"Command",[306,423,424],{},"Folder",[306,426,427],{},"Namespace",[313,429,430,447,464,480,497,518,532,549,566,583,600,617,634,651,668,685,702,719,733,750,767,784,801,818,835,852,869,886,903,932,949,963],{},[303,431,432,437,442],{},[318,433,434],{},[203,435,436],{},"osdd:cast",[318,438,439],{},[203,440,441],{},"src\u002FCasts",[318,443,444],{},[203,445,446],{},"Functional\\Orders\\Casts",[303,448,449,454,459],{},[318,450,451],{},[203,452,453],{},"osdd:channel",[318,455,456],{},[203,457,458],{},"src\u002FBroadcasting",[318,460,461],{},[203,462,463],{},"Functional\\Orders\\Broadcasting",[303,465,466,471,476],{},[318,467,468],{},[203,469,470],{},"osdd:class",[318,472,473],{},[203,474,475],{},"src",[318,477,478],{},[203,479,411],{},[303,481,482,487,492],{},[318,483,484],{},[203,485,486],{},"osdd:command",[318,488,489],{},[203,490,491],{},"src\u002FConsole\u002FCommands",[318,493,494],{},[203,495,496],{},"Functional\\Orders\\Console\\Commands",[303,498,499,504,513],{},[318,500,501],{},[203,502,503],{},"osdd:component",[318,505,506,509,510],{},[203,507,508],{},"src\u002FView\u002FComponents",", view in ",[203,511,512],{},"resources\u002Fviews\u002Fcomponents",[318,514,515],{},[203,516,517],{},"Functional\\Orders\\View\\Components",[303,519,520,525,530],{},[318,521,522],{},[203,523,524],{},"osdd:config",[318,526,527],{},[203,528,529],{},"config",[318,531],{},[303,533,534,539,544],{},[318,535,536],{},[203,537,538],{},"osdd:controller",[318,540,541],{},[203,542,543],{},"src\u002FHttp\u002FControllers",[318,545,546],{},[203,547,548],{},"Functional\\Orders\\Http\\Controllers",[303,550,551,556,561],{},[318,552,553],{},[203,554,555],{},"osdd:enum",[318,557,558],{},[203,559,560],{},"src\u002FEnums",[318,562,563],{},[203,564,565],{},"Functional\\Orders\\Enums",[303,567,568,573,578],{},[318,569,570],{},[203,571,572],{},"osdd:event",[318,574,575],{},[203,576,577],{},"src\u002FEvents",[318,579,580],{},[203,581,582],{},"Functional\\Orders\\Events",[303,584,585,590,595],{},[318,586,587],{},[203,588,589],{},"osdd:exception",[318,591,592],{},[203,593,594],{},"src\u002FExceptions",[318,596,597],{},[203,598,599],{},"Functional\\Orders\\Exceptions",[303,601,602,607,612],{},[318,603,604],{},[203,605,606],{},"osdd:factory",[318,608,609],{},[203,610,611],{},"database\u002Ffactories",[318,613,614],{},[203,615,616],{},"Functional\\Orders\\Database\\Factories",[303,618,619,624,629],{},[318,620,621],{},[203,622,623],{},"osdd:interface",[318,625,626],{},[203,627,628],{},"src\u002FContracts",[318,630,631],{},[203,632,633],{},"Functional\\Orders\\Contracts",[303,635,636,641,646],{},[318,637,638],{},[203,639,640],{},"osdd:job",[318,642,643],{},[203,644,645],{},"src\u002FJobs",[318,647,648],{},[203,649,650],{},"Functional\\Orders\\Jobs",[303,652,653,658,663],{},[318,654,655],{},[203,656,657],{},"osdd:job-middleware",[318,659,660],{},[203,661,662],{},"src\u002FJobs\u002FMiddleware",[318,664,665],{},[203,666,667],{},"Functional\\Orders\\Jobs\\Middleware",[303,669,670,675,680],{},[318,671,672],{},[203,673,674],{},"osdd:listener",[318,676,677],{},[203,678,679],{},"src\u002FListeners",[318,681,682],{},[203,683,684],{},"Functional\\Orders\\Listeners",[303,686,687,692,697],{},[318,688,689],{},[203,690,691],{},"osdd:mail",[318,693,694],{},[203,695,696],{},"src\u002FMail",[318,698,699],{},[203,700,701],{},"Functional\\Orders\\Mail",[303,703,704,709,714],{},[318,705,706],{},[203,707,708],{},"osdd:middleware",[318,710,711],{},[203,712,713],{},"src\u002FHttp\u002FMiddleware",[318,715,716],{},[203,717,718],{},"Functional\\Orders\\Http\\Middleware",[303,720,721,726,731],{},[318,722,723],{},[203,724,725],{},"osdd:migration",[318,727,728],{},[203,729,730],{},"database\u002Fmigrations",[318,732],{},[303,734,735,740,745],{},[318,736,737],{},[203,738,739],{},"osdd:model",[318,741,742],{},[203,743,744],{},"src\u002FModels",[318,746,747],{},[203,748,749],{},"Functional\\Orders\\Models",[303,751,752,757,762],{},[318,753,754],{},[203,755,756],{},"osdd:notification",[318,758,759],{},[203,760,761],{},"src\u002FNotifications",[318,763,764],{},[203,765,766],{},"Functional\\Orders\\Notifications",[303,768,769,774,779],{},[318,770,771],{},[203,772,773],{},"osdd:observer",[318,775,776],{},[203,777,778],{},"src\u002FObservers",[318,780,781],{},[203,782,783],{},"Functional\\Orders\\Observers",[303,785,786,791,796],{},[318,787,788],{},[203,789,790],{},"osdd:policy",[318,792,793],{},[203,794,795],{},"src\u002FPolicies",[318,797,798],{},[203,799,800],{},"Functional\\Orders\\Policies",[303,802,803,808,813],{},[318,804,805],{},[203,806,807],{},"osdd:provider",[318,809,810],{},[203,811,812],{},"src\u002FProviders",[318,814,815],{},[203,816,817],{},"Functional\\Orders\\Providers",[303,819,820,825,830],{},[318,821,822],{},[203,823,824],{},"osdd:request",[318,826,827],{},[203,828,829],{},"src\u002FHttp\u002FRequests",[318,831,832],{},[203,833,834],{},"Functional\\Orders\\Http\\Requests",[303,836,837,842,847],{},[318,838,839],{},[203,840,841],{},"osdd:resource",[318,843,844],{},[203,845,846],{},"src\u002FHttp\u002FResources",[318,848,849],{},[203,850,851],{},"Functional\\Orders\\Http\\Resources",[303,853,854,859,864],{},[318,855,856],{},[203,857,858],{},"osdd:rule",[318,860,861],{},[203,862,863],{},"src\u002FRules",[318,865,866],{},[203,867,868],{},"Functional\\Orders\\Rules",[303,870,871,876,881],{},[318,872,873],{},[203,874,875],{},"osdd:scope",[318,877,878],{},[203,879,880],{},"src\u002FModels\u002FScopes",[318,882,883],{},[203,884,885],{},"Functional\\Orders\\Models\\Scopes",[303,887,888,893,898],{},[318,889,890],{},[203,891,892],{},"osdd:seeder",[318,894,895],{},[203,896,897],{},"database\u002Fseeders",[318,899,900],{},[203,901,902],{},"Functional\\Orders\\Database\\Seeders",[303,904,905,910,923],{},[318,906,907],{},[203,908,909],{},"osdd:test",[318,911,912,915,916,919,920],{},[203,913,914],{},"tests\u002FFeature",", or ",[203,917,918],{},"tests\u002FUnit"," with ",[203,921,922],{},"--unit",[318,924,925,928,929],{},[203,926,927],{},"Functional\\Orders\\Tests\\Feature"," \u002F ",[203,930,931],{},"Unit",[303,933,934,939,944],{},[318,935,936],{},[203,937,938],{},"osdd:trait",[318,940,941],{},[203,942,943],{},"src\u002FConcerns",[318,945,946],{},[203,947,948],{},"Functional\\Orders\\Concerns",[303,950,951,956,961],{},[318,952,953],{},[203,954,955],{},"osdd:view",[318,957,958],{},[203,959,960],{},"resources\u002Fviews",[318,962],{},[303,964,965,970,974],{},[318,966,967],{},[203,968,969],{},"osdd:*-table",[318,971,972],{},[203,973,730],{},[318,975],{},[199,977,978,979,981,982,985,986,989,990,993],{},"Sub-folders work like with ",[203,980,205],{},": ",[203,983,984],{},"osdd:model Admin\u002FRole"," writes ",[203,987,988],{},"src\u002FModels\u002FAdmin\u002FRole.php"," in the ",[203,991,992],{},"Functional\\Orders\\Models\\Admin"," namespace.",[250,995,997],{"id":996},"generators-that-wire-the-provider","Generators that wire the provider",[199,999,1000],{},"These generators also update the layer, so the new file is loaded without editing anything:",[297,1002,1003,1012],{},[300,1004,1005],{},[303,1006,1007,1009],{},[306,1008,421],{},[306,1010,1011],{},"Adds",[313,1013,1014,1032,1045,1059,1072,1085,1110],{},[303,1015,1016,1023],{},[318,1017,1018,1020,1021],{},[203,1019,725],{},", ",[203,1022,969],{},[318,1024,1025,1028,1029],{},[203,1026,1027],{},"$this->loadMigrationsFrom(__DIR__ . '\u002F..\u002F..\u002Fdatabase\u002Fmigrations');"," to ",[203,1030,1031],{},"boot()",[303,1033,1034,1038],{},[318,1035,1036],{},[203,1037,892],{},[318,1039,1040,1028,1043],{},[203,1041,1042],{},"$this->loadSeeders([\\Functional\\Orders\\Database\\Seeders\\OrdersSeeder::class]);",[203,1044,1031],{},[303,1046,1047,1051],{},[318,1048,1049],{},[203,1050,524],{},[318,1052,1053,1028,1056],{},[203,1054,1055],{},"$this->overrideConfigFrom(__DIR__ . '\u002F..\u002F..\u002Fconfig\u002Forders.php', 'orders');",[203,1057,1058],{},"register()",[303,1060,1061,1065],{},[318,1062,1063],{},[203,1064,486],{},[318,1066,1067,1028,1070],{},[203,1068,1069],{},"$this->commands([\\Functional\\Orders\\Console\\Commands\\SyncOrders::class]);",[203,1071,1031],{},[303,1073,1074,1078],{},[318,1075,1076],{},[203,1077,955],{},[318,1079,1080,1028,1083],{},[203,1081,1082],{},"$this->withViews(__DIR__ . '\u002F..\u002F..\u002Fresources\u002Fviews');",[203,1084,1031],{},[303,1086,1087,1091],{},[318,1088,1089],{},[203,1090,503],{},[318,1092,1093,1096,1097,1100,1101,1096,1104,1107,1108],{},[203,1094,1095],{},"withViews()"," (unless ",[203,1098,1099],{},"--inline",") and ",[203,1102,1103],{},"$this->withComponents('Functional\\\\Orders\\\\View\\\\Components');",[203,1105,1106],{},"--view",") to ",[203,1109,1031],{},[303,1111,1112,1116],{},[318,1113,1114],{},[203,1115,807],{},[318,1117,1118,1119,1122,1123],{},"The new provider to ",[203,1120,1121],{},"extra.laravel.providers"," in the layer's ",[203,1124,262],{},[199,1126,1127,1128,1130,1131,1134,1135,1020,1138,1141,1142,1145,1146,1149],{},"They edit the first class of the layer's ",[203,1129,1121],{}," found on disk, else ",[203,1132,1133],{},"src\u002FProviders\u002F\u003CPackage>ServiceProvider.php",", with the package name in StudlyCase as in the layer namespace: ",[203,1136,1137],{},"OrdersServiceProvider",[203,1139,1140],{},"OrderLinesServiceProvider"," for ",[203,1143,1144],{},"functional\u002Forder-lines",". The ",[203,1147,1148],{},"__DIR__"," path is computed from the provider's folder. They print what they did:",[212,1151,1156],{"className":1152,"code":1154,"language":1155},[1153],"language-text","Registered [database\u002Fmigrations] in [functional\u002Forders\u002Fsrc\u002FProviders\u002FOrdersServiceProvider.php].\n","text",[203,1157,1154],{"__ignoreMap":217},[199,1159,1160],{},"The injections are idempotent:",[1162,1163,1164,1176,1185,1188],"ul",{},[1165,1166,1167,1168,1171,1172,1175],"li",{},"A call the provider already makes is not added again, whatever its layout: spacing (Pint writes ",[203,1169,1170],{},"__DIR__.'\u002F..\u002F..\u002Fdatabase\u002Fmigrations'","), line breaks, comments, a trailing comma, or the short name of an imported class (",[203,1173,1174],{},"loadSeeders([OrdersSeeder::class])",").",[1165,1177,1178,1180,1181,1184],{},[203,1179,1095],{}," and ",[203,1182,1183],{},"withComponents()"," are added only when the provider does not call them at all.",[1165,1186,1187],{},"A commented-out call does not count.",[1165,1189,1190,1191,1194],{},"When the provider imports the class, the added line uses its short name: ",[203,1192,1193],{},"$this->loadSeeders([AdminSeeder::class]);",".",[199,1196,1197,1198,1200,1201,1203],{},"When the layer has no provider, or the provider has no ",[203,1199,1031],{}," or ",[203,1202,1058],{}," method, the file is still generated and the command prints the line to add by hand:",[212,1205,1208],{"className":1206,"code":1207,"language":1155},[1153],"Layer [functional\u002Forders] has no service provider. Add this line to the boot() method of its provider:\n",[203,1209,1207],{"__ignoreMap":217},[250,1211,1213],{"id":1212},"examples","Examples",[1215,1216,1218],"h3",{"id":1217},"model-and-its-companions","Model and its companions",[199,1220,1221,1223,1224,1227],{},[203,1222,739],{}," accepts the options of ",[203,1225,1226],{},"make:model"," and creates every companion in the same layer:",[212,1229,1231],{"className":214,"code":1230,"language":216,"meta":217,"style":217},"php artisan osdd:model Order --layer=functional\u002Forders --factory --migration --seed --policy --resource --requests\n",[203,1232,1233],{"__ignoreMap":217},[221,1234,1235,1237,1239,1241,1243,1246,1249,1252,1255,1258,1261],{"class":223,"line":224},[221,1236,228],{"class":227},[221,1238,232],{"class":231},[221,1240,235],{"class":231},[221,1242,238],{"class":231},[221,1244,1245],{"class":231}," --layer=functional\u002Forders",[221,1247,1248],{"class":231}," --factory",[221,1250,1251],{"class":231}," --migration",[221,1253,1254],{"class":231}," --seed",[221,1256,1257],{"class":231}," --policy",[221,1259,1260],{"class":231}," --resource",[221,1262,1263],{"class":231}," --requests\n",[212,1265,1268],{"className":1266,"code":1267,"language":1155},[1153],"functional\u002Forders\u002F\n├── src\u002FModels\u002FOrder.php\n├── src\u002FPolicies\u002FOrderPolicy.php\n├── src\u002FHttp\u002FControllers\u002FOrderController.php\n├── src\u002FHttp\u002FRequests\u002FStoreOrderRequest.php\n├── src\u002FHttp\u002FRequests\u002FUpdateOrderRequest.php\n└── database\u002F\n    ├── factories\u002FOrderFactory.php\n    ├── migrations\u002F\u003Ctimestamp>_create_orders_table.php\n    └── seeders\u002FOrderSeeder.php\n",[203,1269,1267],{"__ignoreMap":217},[199,1271,1272,1273,1275],{},"The controller is built like ",[203,1274,1226],{}," builds it:",[297,1277,1278,1288],{},[300,1279,1280],{},[303,1281,1282,1285],{},[306,1283,1284],{},"Option",[306,1286,1287],{},"Controller",[313,1289,1290,1300,1310,1320,1337],{},[303,1291,1292,1297],{},[318,1293,1294],{},[203,1295,1296],{},"--controller",[318,1298,1299],{},"A plain controller",[303,1301,1302,1307],{},[318,1303,1304],{},[203,1305,1306],{},"--resource",[318,1308,1309],{},"A resource controller for the model",[303,1311,1312,1317],{},[318,1313,1314],{},[203,1315,1316],{},"--api",[318,1318,1319],{},"An API controller for the model",[303,1321,1322,1327],{},[318,1323,1324],{},[203,1325,1326],{},"--requests",[318,1328,1329,1330,1180,1333,1336],{},"Also the ",[203,1331,1332],{},"Store",[203,1334,1335],{},"Update"," form requests",[303,1338,1339,1347],{},[318,1340,1341,1020,1344],{},[203,1342,1343],{},"--test",[203,1345,1346],{},"--pest",[318,1348,1349],{},"Passed on to the controller",[199,1351,1352,1355,1356,1359,1360,1363,1364,1367],{},[203,1353,1354],{},"--all"," creates the factory, migration, seeder, policy, resource controller and form requests at once. With ",[203,1357,1358],{},"--factory",", the model gets ",[203,1361,1362],{},"use HasFactory;"," and a ",[203,1365,1366],{},"#[UseFactory(OrderFactory::class)]"," attribute pointing to the layer's factory.",[199,1369,1370,1371,1373,1374,1377,1378,1381,1382,1384,1385,1388],{},"When the model already exists, ",[203,1372,739],{}," prints ",[203,1375,1376],{},"Model already exists."," and, in a terminal, asks ",[203,1379,1380],{},"Do you want to generate additional components for the model?"," before creating the components you passed. Without a terminal or with ",[203,1383,376],{},", it creates them without asking. ",[203,1386,1387],{},"--force"," overwrites the model.",[1215,1390,1392],{"id":1391},"migration","Migration",[212,1394,1396],{"className":214,"code":1395,"language":216,"meta":217,"style":217},"php artisan osdd:migration add_status_to_orders_table --table=orders --layer=functional\u002Forders\n# functional\u002Forders\u002Fdatabase\u002Fmigrations\u002F\u003Ctimestamp>_add_status_to_orders_table.php\n",[203,1397,1398,1415],{"__ignoreMap":217},[221,1399,1400,1402,1404,1407,1410,1413],{"class":223,"line":224},[221,1401,228],{"class":227},[221,1403,232],{"class":231},[221,1405,1406],{"class":231}," osdd:migration",[221,1408,1409],{"class":231}," add_status_to_orders_table",[221,1411,1412],{"class":231}," --table=orders",[221,1414,241],{"class":231},[221,1416,1417],{"class":223,"line":244},[221,1418,1419],{"class":247},"# functional\u002Forders\u002Fdatabase\u002Fmigrations\u002F\u003Ctimestamp>_add_status_to_orders_table.php\n",[1215,1421,1423],{"id":1422},"framework-tables","Framework tables",[199,1425,1426,1020,1429,1020,1432,1020,1435,1020,1438,1180,1441,1444,1445,1448,1449,412],{},[203,1427,1428],{},"osdd:cache-table",[203,1430,1431],{},"osdd:session-table",[203,1433,1434],{},"osdd:queue-table",[203,1436,1437],{},"osdd:queue-failed-table",[203,1439,1440],{},"osdd:queue-batches-table",[203,1442,1443],{},"osdd:notifications-table"," write the framework migration into the layer's ",[203,1446,1447],{},"database\u002Fmigrations\u002F"," and add ",[203,1450,1451],{},"loadMigrationsFrom()",[212,1453,1455],{"className":214,"code":1454,"language":216,"meta":217,"style":217},"php artisan osdd:notifications-table --layer=technical\u002Fosdd\n",[203,1456,1457],{"__ignoreMap":217},[221,1458,1459,1461,1463,1466],{"class":223,"line":224},[221,1460,228],{"class":227},[221,1462,232],{"class":231},[221,1464,1465],{"class":231}," osdd:notifications-table",[221,1467,1468],{"class":231}," --layer=technical\u002Fosdd\n",[199,1470,1471,1472,1475,1476,1478,1479,1484,1485,1487,1488,1491],{},"They fail with exit code 1 and ",[203,1473,1474],{},"Migration already exists."," when a layer, the root ",[203,1477,1447],{}," or a registered migration path already creates the table. After ",[1480,1481,1482],"a",{"href":111},[203,1483,110],{},", the cache, jobs, batches, failed jobs and sessions tables already exist: only ",[203,1486,1443],{}," is usually needed. The ",[203,1489,1490],{},"queue:table","-style aliases stay on Laravel's commands.",[1215,1493,1495],{"id":1494},"factory","Factory",[212,1497,1499],{"className":214,"code":1498,"language":216,"meta":217,"style":217},"php artisan osdd:factory Order --layer=functional\u002Forders\n# functional\u002Forders\u002Fdatabase\u002Ffactories\u002FOrderFactory.php, class OrderFactory\n",[203,1500,1501,1514],{"__ignoreMap":217},[221,1502,1503,1505,1507,1510,1512],{"class":223,"line":224},[221,1504,228],{"class":227},[221,1506,232],{"class":231},[221,1508,1509],{"class":231}," osdd:factory",[221,1511,238],{"class":231},[221,1513,241],{"class":231},[221,1515,1516],{"class":223,"line":244},[221,1517,1518],{"class":247},"# functional\u002Forders\u002Fdatabase\u002Ffactories\u002FOrderFactory.php, class OrderFactory\n",[199,1520,1521,1180,1524,1527,1528,1194],{},[203,1522,1523],{},"osdd:factory Order",[203,1525,1526],{},"osdd:factory OrderFactory"," both create ",[203,1529,1530],{},"OrderFactory",[1215,1532,1534],{"id":1533},"event-and-listener","Event and listener",[212,1536,1538],{"className":214,"code":1537,"language":216,"meta":217,"style":217},"php artisan osdd:event OrderPlaced --layer=functional\u002Forders\nphp artisan osdd:listener SendOrderConfirmation --event=OrderPlaced --layer=functional\u002Forders\n",[203,1539,1540,1554],{"__ignoreMap":217},[221,1541,1542,1544,1546,1549,1552],{"class":223,"line":224},[221,1543,228],{"class":227},[221,1545,232],{"class":231},[221,1547,1548],{"class":231}," osdd:event",[221,1550,1551],{"class":231}," OrderPlaced",[221,1553,241],{"class":231},[221,1555,1556,1558,1560,1563,1566,1569],{"class":223,"line":244},[221,1557,228],{"class":227},[221,1559,232],{"class":231},[221,1561,1562],{"class":231}," osdd:listener",[221,1564,1565],{"class":231}," SendOrderConfirmation",[221,1567,1568],{"class":231}," --event=OrderPlaced",[221,1570,241],{"class":231},[199,1572,1573,1576,1577,1579,1580,1583,1584,1587,1588,1591],{},[203,1574,1575],{},"--event=OrderPlaced"," is taken from the layer's ",[203,1578,80],{}," namespace. Start the name with a backslash for an event of another layer: ",[203,1581,1582],{},"--event='\\Functional\\Orders\\Events\\OrderPlaced'",". To register the listener, turn on ",[1480,1585,1586],{"href":81},"event discovery"," or call ",[203,1589,1590],{},"Event::listen()"," in the layer provider.",[1215,1593,421],{"id":1594},"command",[212,1596,1598],{"className":214,"code":1597,"language":216,"meta":217,"style":217},"php artisan osdd:command PruneAbandonedOrders --layer=functional\u002Forders\n# functional\u002Forders\u002Fsrc\u002FConsole\u002FCommands\u002FPruneAbandonedOrders.php\n",[203,1599,1600,1614],{"__ignoreMap":217},[221,1601,1602,1604,1606,1609,1612],{"class":223,"line":224},[221,1603,228],{"class":227},[221,1605,232],{"class":231},[221,1607,1608],{"class":231}," osdd:command",[221,1610,1611],{"class":231}," PruneAbandonedOrders",[221,1613,241],{"class":231},[221,1615,1616],{"class":223,"line":244},[221,1617,1618],{"class":247},"# functional\u002Forders\u002Fsrc\u002FConsole\u002FCommands\u002FPruneAbandonedOrders.php\n",[199,1620,1621,1622,1625,1626,1629],{},"The command adds ",[203,1623,1624],{},"$this->commands([...])"," to the layer provider, so ",[203,1627,1628],{},"php artisan list"," shows it.",[1215,1631,1633],{"id":1632},"view-and-component","View and component",[212,1635,1637],{"className":214,"code":1636,"language":216,"meta":217,"style":217},"php artisan osdd:view orders.index --layer=functional\u002Forders\nphp artisan osdd:component Alert --layer=functional\u002Forders\n",[203,1638,1639,1653],{"__ignoreMap":217},[221,1640,1641,1643,1645,1648,1651],{"class":223,"line":224},[221,1642,228],{"class":227},[221,1644,232],{"class":231},[221,1646,1647],{"class":231}," osdd:view",[221,1649,1650],{"class":231}," orders.index",[221,1652,241],{"class":231},[221,1654,1655,1657,1659,1662,1665],{"class":223,"line":244},[221,1656,228],{"class":227},[221,1658,232],{"class":231},[221,1660,1661],{"class":231}," osdd:component",[221,1663,1664],{"class":231}," Alert",[221,1666,241],{"class":231},[199,1668,1669,1670,1180,1673,1676,1677,1194],{},"Render them as ",[203,1671,1672],{},"view('orders::orders.index')",[203,1674,1675],{},"\u003Cx-orders::alert \u002F>",". See ",[1480,1678,1679],{"href":69},"Views and components",[1215,1681,1683],{"id":1682},"job-middleware","Job middleware",[212,1685,1687],{"className":214,"code":1686,"language":216,"meta":217,"style":217},"php artisan osdd:job-middleware RateLimitedOrders --layer=functional\u002Forders\n# functional\u002Forders\u002Fsrc\u002FJobs\u002FMiddleware\u002FRateLimitedOrders.php\n",[203,1688,1689,1703],{"__ignoreMap":217},[221,1690,1691,1693,1695,1698,1701],{"class":223,"line":224},[221,1692,228],{"class":227},[221,1694,232],{"class":231},[221,1696,1697],{"class":231}," osdd:job-middleware",[221,1699,1700],{"class":231}," RateLimitedOrders",[221,1702,241],{"class":231},[221,1704,1705],{"class":223,"line":244},[221,1706,1707],{"class":247},"# functional\u002Forders\u002Fsrc\u002FJobs\u002FMiddleware\u002FRateLimitedOrders.php\n",[1215,1709,1711],{"id":1710},"provider","Provider",[212,1713,1715],{"className":214,"code":1714,"language":216,"meta":217,"style":217},"php artisan osdd:provider OrderEventsServiceProvider --layer=functional\u002Forders\n# functional\u002Forders\u002Fsrc\u002FProviders\u002FOrderEventsServiceProvider.php, listed in the layer's composer.json\n",[203,1716,1717,1731],{"__ignoreMap":217},[221,1718,1719,1721,1723,1726,1729],{"class":223,"line":224},[221,1720,228],{"class":227},[221,1722,232],{"class":231},[221,1724,1725],{"class":231}," osdd:provider",[221,1727,1728],{"class":231}," OrderEventsServiceProvider",[221,1730,241],{"class":231},[221,1732,1733],{"class":223,"line":244},[221,1734,1735],{"class":247},"# functional\u002Forders\u002Fsrc\u002FProviders\u002FOrderEventsServiceProvider.php, listed in the layer's composer.json\n",[199,1737,1738,1739,1741,1742,1745,1746,1749],{},"The provider is registered in the layer's ",[203,1740,262],{}," only, never in ",[203,1743,1744],{},"bootstrap\u002Fproviders.php",". Run ",[203,1747,1748],{},"composer update functional\u002Forders"," so Laravel discovers it.",[1215,1751,1753],{"id":1752},"test","Test",[212,1755,1757],{"className":214,"code":1756,"language":216,"meta":217,"style":217},"php artisan osdd:test PlaceOrderTest --layer=functional\u002Forders\n# functional\u002Forders\u002Ftests\u002FFeature\u002FPlaceOrderTest.php\n",[203,1758,1759,1773],{"__ignoreMap":217},[221,1760,1761,1763,1765,1768,1771],{"class":223,"line":224},[221,1762,228],{"class":227},[221,1764,232],{"class":231},[221,1766,1767],{"class":231}," osdd:test",[221,1769,1770],{"class":231}," PlaceOrderTest",[221,1772,241],{"class":231},[221,1774,1775],{"class":223,"line":244},[221,1776,1777],{"class":247},"# functional\u002Forders\u002Ftests\u002FFeature\u002FPlaceOrderTest.php\n",[250,1779,1781],{"id":1780},"referencing-another-layer","Referencing another layer",[199,1783,1784,1787,1788,1020,1790,1020,1792,1180,1794,1796,1797,1800,1801,1804],{},[203,1785,1786],{},"--model"," on ",[203,1789,790],{},[203,1791,538],{},[203,1793,773],{},[203,1795,606],{}," resolves a short name inside the current layer: ",[203,1798,1799],{},"--model=Order"," means ",[203,1802,1803],{},"Functional\\Orders\\Models\\Order",". A fully qualified class of another layer, or of a package, is kept as is:",[212,1806,1808],{"className":214,"code":1807,"language":216,"meta":217,"style":217},"php artisan osdd:policy UserOrderPolicy --model='Functional\\Users\\Models\\User' --layer=functional\u002Forders\n",[203,1809,1810],{"__ignoreMap":217},[221,1811,1812,1814,1816,1819,1822,1825,1829,1832,1834],{"class":223,"line":224},[221,1813,228],{"class":227},[221,1815,232],{"class":231},[221,1817,1818],{"class":231}," osdd:policy",[221,1820,1821],{"class":231}," UserOrderPolicy",[221,1823,1824],{"class":231}," --model=",[221,1826,1828],{"class":1827},"sMK4o","'",[221,1830,1831],{"class":231},"Functional\\Users\\Models\\User",[221,1833,1828],{"class":1827},[221,1835,241],{"class":231},[199,1837,1838,1839,1842,1843,1847],{},"The layer then uses ",[203,1840,1841],{},"functional\u002Fusers",": require it, or ",[1480,1844,1845],{"href":123},[203,1846,122],{}," reports it.",[250,1849,1851],{"id":1850},"calling-a-generator-from-code","Calling a generator from code",[212,1853,1856],{"className":1854,"code":1855,"language":228,"meta":217,"style":217},"language-php shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","use Illuminate\\Support\\Facades\\Artisan;\n\nArtisan::call('osdd:model', ['name' => 'Order', '--layer' => 'functional\u002Forders']);\n",[203,1857,1858,1887,1893],{"__ignoreMap":217},[221,1859,1860,1864,1868,1871,1874,1876,1879,1881,1884],{"class":223,"line":224},[221,1861,1863],{"class":1862},"sbssI","use",[221,1865,1867],{"class":1866},"sTEyZ"," Illuminate",[221,1869,1870],{"class":1827},"\\",[221,1872,1873],{"class":1866},"Support",[221,1875,1870],{"class":1827},[221,1877,1878],{"class":1866},"Facades",[221,1880,1870],{"class":1827},[221,1882,1883],{"class":1866},"Artisan",[221,1885,1886],{"class":1827},";\n",[221,1888,1889],{"class":223,"line":244},[221,1890,1892],{"emptyLinePlaceholder":1891},true,"\n",[221,1894,1896,1898,1901,1905,1908,1910,1912,1914,1917,1920,1922,1925,1927,1930,1933,1936,1938,1940,1942,1944,1946,1948,1950,1952,1954],{"class":223,"line":1895},3,[221,1897,1883],{"class":227},[221,1899,1900],{"class":1827},"::",[221,1902,1904],{"class":1903},"s2Zo4","call",[221,1906,1907],{"class":1827},"(",[221,1909,1828],{"class":1827},[221,1911,739],{"class":231},[221,1913,1828],{"class":1827},[221,1915,1916],{"class":1827},",",[221,1918,1919],{"class":1827}," [",[221,1921,1828],{"class":1827},[221,1923,1924],{"class":231},"name",[221,1926,1828],{"class":1827},[221,1928,1929],{"class":1827}," =>",[221,1931,1932],{"class":1827}," '",[221,1934,1935],{"class":231},"Order",[221,1937,1828],{"class":1827},[221,1939,1916],{"class":1827},[221,1941,1932],{"class":1827},[221,1943,258],{"class":231},[221,1945,1828],{"class":1827},[221,1947,1929],{"class":1827},[221,1949,1932],{"class":1827},[221,1951,339],{"class":231},[221,1953,1828],{"class":1827},[221,1955,1956],{"class":1827},"]);\n",[199,1958,1959,1960,1963,1964,1966],{},"Inside a command, ",[203,1961,1962],{},"$this->call(\\Lomkit\\Osdd\\Console\\Commands\\Make\\ModelMakeCommand::class, [...])"," works too. Each call writes into the layer passed to it, even when one process calls the generators for several layers. Check the exit code: an unresolved ",[203,1965,258],{}," returns 1, it does not throw.",[199,1968,1969,1970,1973,1974,1976,1977,1979],{},"The generator classes are ",[203,1971,1972],{},"final",". To change a generator, write your own command that extends the Laravel ",[203,1975,205],{}," command, or call the ",[203,1978,209],{}," one.",[1981,1982,1983],"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 .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}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 .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}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 .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}",{"title":217,"searchDepth":224,"depth":244,"links":1985},[1986,1987,1988,1989,2001,2002],{"id":252,"depth":244,"text":253},{"id":390,"depth":244,"text":391},{"id":996,"depth":244,"text":997},{"id":1212,"depth":244,"text":1213,"children":1990},[1991,1992,1993,1994,1995,1996,1997,1998,1999,2000],{"id":1217,"depth":1895,"text":1218},{"id":1391,"depth":1895,"text":1392},{"id":1422,"depth":1895,"text":1423},{"id":1494,"depth":1895,"text":1495},{"id":1533,"depth":1895,"text":1534},{"id":1594,"depth":1895,"text":421},{"id":1632,"depth":1895,"text":1633},{"id":1682,"depth":1895,"text":1683},{"id":1710,"depth":1895,"text":1711},{"id":1752,"depth":1895,"text":1753},{"id":1780,"depth":244,"text":1781},{"id":1850,"depth":244,"text":1851},"The osdd:* twins of Laravel's make:* commands write inside a layer.","md",null,{},{"title":146,"description":2003},{"loc":147},"dixjWldwKJqhd2aQZfjTAji7oWXNtftYmL08CS1NJdk",[2011,2013],{"title":142,"path":143,"stem":144,"description":2012,"children":-1},"Cache the discovered layers for production, or remove that cache.",{"title":156,"path":157,"stem":158,"description":2014,"children":-1},"The base class of every layer's service provider.",1794437209293]