[{"data":1,"prerenderedAt":546},["ShallowReactive",2],{"navigation":3,"\u002Ftesting-and-tooling\u002Fgenerators":173,"\u002Ftesting-and-tooling\u002Fgenerators-surround":541},[4,27,69,103,113,135],{"title":5,"icon":6,"path":7,"stem":8,"children":9,"page":26},"Getting Started","i-heroicons-star","\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},"Upgrade guide","\u002Fgetting-started\u002Fupgrade-guide","1.getting-started\u002F5.upgrade-guide",false,{"title":28,"icon":29,"path":30,"stem":31,"children":32,"page":26},"Essentials","i-heroicons-shield-check","\u002Fessentials","2.essentials",[33,37,41,45,49,53,57,61,65],{"title":34,"path":35,"stem":36},"Controls","\u002Fessentials\u002Fcontrols","2.essentials\u002F1.controls",{"title":38,"path":39,"stem":40},"Perimeters","\u002Fessentials\u002Fperimeters","2.essentials\u002F2.perimeters",{"title":42,"path":43,"stem":44},"Perimeter classes","\u002Fessentials\u002Fperimeter-classes","2.essentials\u002F3.perimeter-classes",{"title":46,"path":47,"stem":48},"Levels","\u002Fessentials\u002Flevels","2.essentials\u002F4.levels",{"title":50,"path":51,"stem":52},"Boundaries","\u002Fessentials\u002Fboundaries","2.essentials\u002F5.boundaries",{"title":54,"path":55,"stem":56},"Parents","\u002Fessentials\u002Fparents","2.essentials\u002F6.parents",{"title":58,"path":59,"stem":60},"Policies","\u002Fessentials\u002Fpolicies","2.essentials\u002F7.policies",{"title":62,"path":63,"stem":64},"Queries","\u002Fessentials\u002Fqueries","2.essentials\u002F8.queries",{"title":66,"path":67,"stem":68},"Readers","\u002Fessentials\u002Freaders","2.essentials\u002F9.readers",{"title":70,"icon":71,"path":72,"stem":73,"children":74,"page":26},"Search","i-heroicons-magnifying-glass","\u002Fsearch","3.search",[75,79,83,87,91,95,99],{"title":76,"path":77,"stem":78},"Search overview","\u002Fsearch\u002Foverview","3.search\u002F1.overview",{"title":80,"path":81,"stem":82},"Engines","\u002Fsearch\u002Fengines","3.search\u002F2.engines",{"title":84,"path":85,"stem":86},"Keeping the keys fresh","\u002Fsearch\u002Fkeeping-the-keys-fresh","3.search\u002F3.keeping-the-keys-fresh",{"title":88,"path":89,"stem":90},"Exceptions and dates","\u002Fsearch\u002Fexceptions-and-dates","3.search\u002F4.exceptions-and-dates",{"title":92,"path":93,"stem":94},"Searching through a parent","\u002Fsearch\u002Fthrough-a-parent","3.search\u002F5.through-a-parent",{"title":96,"path":97,"stem":98},"Search from the browser","\u002Fsearch\u002Ffrom-the-browser","3.search\u002F6.from-the-browser",{"title":100,"path":101,"stem":102},"Your own search client","\u002Fsearch\u002Fyour-own-client","3.search\u002F7.your-own-client",{"title":104,"icon":105,"path":106,"stem":107,"children":108,"page":26},"Integrations","i-heroicons-puzzle-piece","\u002Fintegrations","4.integrations",[109],{"title":110,"path":111,"stem":112},"laravel-rest-api","\u002Fintegrations\u002Flaravel-rest-api","4.integrations\u002F1.laravel-rest-api",{"title":114,"icon":115,"path":116,"stem":117,"children":118,"page":26},"Testing and Tooling","i-heroicons-wrench-screwdriver","\u002Ftesting-and-tooling","5.testing-and-tooling",[119,123,127,131],{"title":120,"path":121,"stem":122},"Testing","\u002Ftesting-and-tooling\u002Ftesting","5.testing-and-tooling\u002F1.testing",{"title":124,"path":125,"stem":126},"access:check","\u002Ftesting-and-tooling\u002Faccess-check","5.testing-and-tooling\u002F2.access-check",{"title":128,"path":129,"stem":130},"Cache and about","\u002Ftesting-and-tooling\u002Fcache-and-about","5.testing-and-tooling\u002F3.cache-and-about",{"title":132,"path":133,"stem":134},"Generators","\u002Ftesting-and-tooling\u002Fgenerators","5.testing-and-tooling\u002F4.generators",{"title":136,"icon":137,"path":138,"stem":139,"children":140,"page":26},"Digging Deeper","i-heroicons-list-bullet","\u002Fdigging-deeper","6.digging-deeper",[141,145,149,153,157,161,165,169],{"title":142,"path":143,"stem":144},"Abilities","\u002Fdigging-deeper\u002Fabilities","6.digging-deeper\u002F1.abilities",{"title":146,"path":147,"stem":148},"Kept decisions","\u002Fdigging-deeper\u002Fdecisions","6.digging-deeper\u002F2.decisions",{"title":150,"path":151,"stem":152},"Batched decisions","\u002Fdigging-deeper\u002Fbatched-decisions","6.digging-deeper\u002F3.batched-decisions",{"title":154,"path":155,"stem":156},"Row checks","\u002Fdigging-deeper\u002Frow-checks","6.digging-deeper\u002F4.row-checks",{"title":158,"path":159,"stem":160},"Several brands","\u002Fdigging-deeper\u002Fseveral-brands","6.digging-deeper\u002F5.several-brands",{"title":162,"path":163,"stem":164},"Row context","\u002Fdigging-deeper\u002Frow-context","6.digging-deeper\u002F6.row-context",{"title":166,"path":167,"stem":168},"What is public in 1.x","\u002Fdigging-deeper\u002Fpublic-api","6.digging-deeper\u002F7.public-api",{"title":170,"path":171,"stem":172},"Use with AI","\u002Fdigging-deeper\u002Fuse-with-ai","6.digging-deeper\u002F8.use-with-ai",{"id":174,"title":132,"body":175,"description":532,"extension":533,"links":534,"meta":535,"navigation":536,"path":133,"seo":537,"sitemap":538,"stem":134,"updatedAt":539,"__hash__":540},"docs\u002F5.testing-and-tooling\u002F4.generators.md",{"type":176,"value":177,"toc":527},"minimark",[178,259,266,274,374,402,408,414,419,443,447,451,454,468,516,523],[179,180,185],"pre",{"className":181,"code":182,"language":183,"meta":184,"style":184},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","php artisan make:perimeter ClientPerimeter\nphp artisan make:perimeter EditorialPerimeter --hooks\nphp artisan make:control PostControl --model=Post --perimeters=ClientPerimeter --perimeters=EditorialPerimeter\nphp artisan make:control CommentControl --parent=post\n","bash","",[186,187,188,207,222,244],"code",{"__ignoreMap":184},[189,190,193,197,201,204],"span",{"class":191,"line":192},"line",1,[189,194,196],{"class":195},"sBMFI","php",[189,198,200],{"class":199},"sfazB"," artisan",[189,202,203],{"class":199}," make:perimeter",[189,205,206],{"class":199}," ClientPerimeter\n",[189,208,210,212,214,216,219],{"class":191,"line":209},2,[189,211,196],{"class":195},[189,213,200],{"class":199},[189,215,203],{"class":199},[189,217,218],{"class":199}," EditorialPerimeter",[189,220,221],{"class":199}," --hooks\n",[189,223,225,227,229,232,235,238,241],{"class":191,"line":224},3,[189,226,196],{"class":195},[189,228,200],{"class":199},[189,230,231],{"class":199}," make:control",[189,233,234],{"class":199}," PostControl",[189,236,237],{"class":199}," --model=Post",[189,239,240],{"class":199}," --perimeters=ClientPerimeter",[189,242,243],{"class":199}," --perimeters=EditorialPerimeter\n",[189,245,247,249,251,253,256],{"class":191,"line":246},4,[189,248,196],{"class":195},[189,250,200],{"class":199},[189,252,231],{"class":199},[189,254,255],{"class":199}," CommentControl",[189,257,258],{"class":199}," --parent=post\n",[260,261,263],"h2",{"id":262},"makecontrol",[186,264,265],{},"make:control",[267,268,269,270,273],"p",{},"Writes a control into ",[186,271,272],{},"app\u002FAccess\u002FControls",".",[275,276,277,290],"table",{},[278,279,280],"thead",{},[281,282,283,287],"tr",{},[284,285,286],"th",{},"Option",[284,288,289],{},"Effect",[291,292,293,325,353],"tbody",{},[281,294,295,305],{},[296,297,298,301,302],"td",{},[186,299,300],{},"--model",", ",[186,303,304],{},"-m",[296,306,307,308,311,312,315,316,319,320,311,322,273],{},"The model of the control: ",[186,309,310],{},"--model=Post"," for ",[186,313,314],{},"App\\Models\\Post",", or a fully qualified class such as ",[186,317,318],{},"--model='Domain\\Blog\\Post'",". Without it, the model is named after the control: ",[186,321,314],{},[186,323,324],{},"PostControl",[281,326,327,335],{},[296,328,329,301,332],{},[186,330,331],{},"--perimeters",[186,333,334],{},"-p",[296,336,337,338,341,342,301,345,348,349,352],{},"A perimeter class of ",[186,339,340],{},"app\u002FAccess\u002FPerimeters",", repeatable. The control gets an ",[186,343,344],{},"allowed()",[186,346,347],{},"should()"," and ",[186,350,351],{},"query()"," callback for each one, which refuse everything until you write them, except the callbacks of the hooks that the class overrides.",[281,354,355,360],{},[296,356,357],{},[186,358,359],{},"--parent",[296,361,362,363,366,367,373],{},"A ",[186,364,365],{},"belongsTo"," relation of the model, repeatable: writes a ",[368,369,370],"a",{"href":55},[186,371,372],{},"ThroughParent"," entry for it.",[375,376,377,381,390,393],"ul",{},[378,379,380],"li",{},"The command refuses, and writes nothing, when the model is not an Eloquent model class.",[378,382,383,384,389],{},"The perimeters are listed as loose perimeters, which add up: group the levels of a hierarchy in ",[368,385,386],{"href":47},[186,387,388],{},"Levels::of()"," yourself.",[378,391,392],{},"A perimeter class whose constructor requires arguments, or is not public, is left out with a warning: list it in the control with its named constructor.",[378,394,395,396,401],{},"The control declares no boundary: add a ",[368,397,398],{"href":51},[186,399,400],{},"boundary()"," method when the model needs one.",[267,403,404,405,273],{},"See ",[368,406,34],{"href":407},"\u002Fessentials\u002Fcontrols#generating-a-control",[260,409,411],{"id":410},"makeperimeter",[186,412,413],{},"make:perimeter",[267,415,416,417,273],{},"Writes a perimeter class into ",[186,418,340],{},[375,420,421,424],{},[378,422,423],{},"Without option, the class is empty: its rules are the callbacks declared in the control.",[378,425,426,429,430,301,433,348,436,439,440,442],{},[186,427,428],{},"--hooks"," generates the protected hooks ",[186,431,432],{},"allows()",[186,434,435],{},"includes()",[186,437,438],{},"scope()",", which refuse everything until you write them, for a rule shared by several controls. Remove ",[186,441,435],{}," to check the rows in SQL.",[267,444,404,445,273],{},[368,446,42],{"href":43},[260,448,450],{"id":449},"stubs","Stubs",[267,452,453],{},"Publish the stubs to change what the commands write:",[179,455,457],{"className":181,"code":456,"language":183,"meta":184,"style":184},"php artisan stub:publish\n",[186,458,459],{"__ignoreMap":184},[189,460,461,463,465],{"class":191,"line":192},[189,462,196],{"class":195},[189,464,200],{"class":199},[189,466,467],{"class":199}," stub:publish\n",[275,469,470,480],{},[278,471,472],{},[281,473,474,477],{},[284,475,476],{},"Stub",[284,478,479],{},"Used by",[291,481,482,493,504],{},[281,483,484,489],{},[296,485,486],{},[186,487,488],{},"stubs\u002Fcontrol.stub",[296,490,491],{},[186,492,265],{},[281,494,495,500],{},[296,496,497],{},[186,498,499],{},"stubs\u002Fperimeter.plain.stub",[296,501,502],{},[186,503,413],{},[281,505,506,511],{},[296,507,508],{},[186,509,510],{},"stubs\u002Fperimeter.hooks.stub",[296,512,513],{},[186,514,515],{},"make:perimeter --hooks",[267,517,518,519,522],{},"A published stub replaces the one of the package. After an upgrade, publish them again with ",[186,520,521],{},"php artisan stub:publish --force",", or apply the changes of the package to your copies.",[524,525,526],"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 .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":184,"searchDepth":192,"depth":209,"links":528},[529,530,531],{"id":262,"depth":209,"text":265},{"id":410,"depth":209,"text":413},{"id":449,"depth":209,"text":450},"make:control and make:perimeter scaffold the controls and the perimeter classes, from stubs that you can publish and change.","md",null,{},true,{"title":132,"description":532},{"loc":133,"lastmod":539},"2026-11-21T15:24:08+01:00","_TkbiJeKKb0qtzOn9SVP-T5PM8jYViRRqeb6COF2TwM",[542,544],{"title":128,"path":129,"stem":130,"description":543,"children":-1},"Cache the control of each model with access:cache in every deployment, and read the state of the package in the Access Control section of php artisan about.",{"title":142,"path":143,"stem":144,"description":545,"children":-1},"The Ability value object names what a reader wants to do: how a policy method maps to an ability, how to change the mapping, and how business abilities work.",1795277181851]