[{"data":1,"prerenderedAt":563},["ShallowReactive",2],{"navigation":3,"\u002Ftesting-and-tooling\u002Fcache-and-about":173,"\u002Ftesting-and-tooling\u002Fcache-and-about-surround":558},[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":128,"body":175,"description":549,"extension":550,"links":551,"meta":552,"navigation":553,"path":129,"seo":554,"sitemap":555,"stem":130,"updatedAt":556,"__hash__":557},"docs\u002F5.testing-and-tooling\u002F3.cache-and-about.md",{"type":176,"value":177,"toc":545},"minimark",[178,183,219,238,291,298,302,308,325,378,508,538,541],[179,180,182],"h2",{"id":181},"caching-the-controls","Caching the controls",[184,185,190],"pre",{"className":186,"code":187,"language":188,"meta":189,"style":189},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","php artisan access:cache\nphp artisan access:clear\n","bash","",[191,192,193,209],"code",{"__ignoreMap":189},[194,195,198,202,206],"span",{"class":196,"line":197},"line",1,[194,199,201],{"class":200},"sBMFI","php",[194,203,205],{"class":204},"sfazB"," artisan",[194,207,208],{"class":204}," access:cache\n",[194,210,212,214,216],{"class":196,"line":211},2,[194,213,201],{"class":200},[194,215,205],{"class":204},[194,217,218],{"class":204}," access:clear\n",[220,221,222,225,226,229,230,233,234,237],"p",{},[191,223,224],{},"access:cache"," writes the control of each discovered model, and the models that the ",[191,227,228],{},"reindexWhen()"," rules of the controls watch, into ",[191,231,232],{},"bootstrap\u002Fcache",". ",[191,235,236],{},"access:clear"," removes both files.",[239,240,241,257,262,272,275],"ul",{},[242,243,244,247,248,250,251,247,254,256],"li",{},[191,245,246],{},"php artisan optimize"," runs ",[191,249,224],{},", and ",[191,252,253],{},"php artisan optimize:clear",[191,255,236],{},".",[242,258,259,260,256],{},"The cache is used as it is, the way Laravel uses its route and event caches: run it again in every deployment, after adding, moving or deleting a control, or adding a ",[191,261,228],{},[242,263,264,265,256],{},"It runs once every service provider has booted, so it caches the controls of every directory passed to ",[266,267,269],"a",{"href":268},"\u002Fessentials\u002Fcontrols#discovery",[191,270,271],{},"Access::discoverControlsIn()",[242,273,274],{},"A cached control class that was deleted since is skipped.",[242,276,277,279,280,283,284,287,288,256],{},[191,278,124],{}," reports a stale cache: ",[191,281,282],{},"stale_control_cache"," for the controls, ",[191,285,286],{},"stale_watch_cache"," for the watched models. See ",[266,289,124],{"href":290},"\u002Ftesting-and-tooling\u002Faccess-check#problems",[220,292,293,294,297],{},"Without the cache, the package discovers the controls when a model first asks for its control. With Laravel Scout installed, the first Eloquent write of a process also builds the control of every discovered ",[191,295,296],{},"ControlledSearchable"," model, to know which writes reindex which documents: the cache spares that work in production.",[179,299,301],{"id":300},"the-about-command","The about command",[220,303,304,307],{},[191,305,306],{},"php artisan about"," prints an \"Access Control\" section:",[184,309,311],{"className":186,"code":310,"language":188,"meta":189,"style":189},"php artisan about --only=access_control\n",[191,312,313],{"__ignoreMap":189},[194,314,315,317,319,322],{"class":196,"line":197},[194,316,201],{"class":200},[194,318,205],{"class":204},[194,320,321],{"class":204}," about",[194,323,324],{"class":204}," --only=access_control\n",[184,326,330],{"className":327,"code":328,"language":329,"meta":189,"style":189},"language-txt shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","  Access Control ................................................................\n  Automatic policies ................................................. registered\n  Cache .............................................................. not cached\n  Controls ................................................................... 12\n  Discovery paths .................................................. app\u002FAccess\u002FControls\n  Scout ...................................................... installed, meilisearch driver\n  Version ........................................................................ 1.0.0\n  laravel-rest-api ............................... installed, AccessControlExtension enabled\n","txt",[191,331,332,337,342,348,354,360,366,372],{"__ignoreMap":189},[194,333,334],{"class":196,"line":197},[194,335,336],{},"  Access Control ................................................................\n",[194,338,339],{"class":196,"line":211},[194,340,341],{},"  Automatic policies ................................................. registered\n",[194,343,345],{"class":196,"line":344},3,[194,346,347],{},"  Cache .............................................................. not cached\n",[194,349,351],{"class":196,"line":350},4,[194,352,353],{},"  Controls ................................................................... 12\n",[194,355,357],{"class":196,"line":356},5,[194,358,359],{},"  Discovery paths .................................................. app\u002FAccess\u002FControls\n",[194,361,363],{"class":196,"line":362},6,[194,364,365],{},"  Scout ...................................................... installed, meilisearch driver\n",[194,367,369],{"class":196,"line":368},7,[194,370,371],{},"  Version ........................................................................ 1.0.0\n",[194,373,375],{"class":196,"line":374},8,[194,376,377],{},"  laravel-rest-api ............................... installed, AccessControlExtension enabled\n",[379,380,381,394],"table",{},[382,383,384],"thead",{},[385,386,387,391],"tr",{},[388,389,390],"th",{},"Row",[388,392,393],{},"Value",[395,396,397,408,421,437,457,478,491],"tbody",{},[385,398,399,405],{},[400,401,402],"td",{},[191,403,404],{},"Version",[400,406,407],{},"The installed version of the package.",[385,409,410,414],{},[400,411,412],{},[191,413,34],{},[400,415,416,417,420],{},"The number of controls, read from the cache when it exists, else from the discovery paths. No control is built. When discovery fails, the row reads ",[191,418,419],{},"discovery failed:"," and the first line of the error.",[385,422,423,428],{},[400,424,425],{},[191,426,427],{},"Discovery paths",[400,429,430,431,434,435,256],{},"Every directory the controls are discovered in, relative to the base path: ",[191,432,433],{},"app\u002FAccess\u002FControls"," first, then the ones added with ",[191,436,271],{},[385,438,439,444],{},[400,440,441],{},[191,442,443],{},"Cache",[400,445,446,449,450,452,453,456],{},[191,447,448],{},"cached"," when ",[191,451,224],{}," wrote its file, ",[191,454,455],{},"not cached"," otherwise.",[385,458,459,464],{},[400,460,461],{},[191,462,463],{},"Automatic policies",[400,465,466,469,470,473,474,477],{},[191,467,468],{},"registered"," after ",[191,471,472],{},"Access::registerPolicies()",", ",[191,475,476],{},"not registered"," otherwise, or when the application replaced the policy guesser afterwards.",[385,479,480,485],{},[400,481,482],{},[191,483,484],{},"Scout",[400,486,487,490],{},[191,488,489],{},"not installed",", or the driver of the environment.",[385,492,493,497],{},[400,494,495],{},[191,496,110],{},[400,498,499,473,501,504,505,256],{},[191,500,489],{},[191,502,503],{},"AccessControlExtension enabled",", or ",[191,506,507],{},"AccessControlExtension listed in rest.disabled_extensions",[239,509,510,520,523],{},[242,511,512,515,516,519],{},[191,513,514],{},"--json"," gives the same rows under the ",[191,517,518],{},"access_control"," key.",[242,521,522],{},"The section is registered when the application runs in the console.",[242,524,525,526,529,530,533,534,537],{},"An empty value prints ",[191,527,528],{},"none",", and a row that cannot be read prints ",[191,531,532],{},"unavailable:"," with the first line of the error: the section never makes ",[191,535,536],{},"about"," fail.",[220,539,540],{},"Add this section when you report an issue.",[542,543,544],"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":189,"searchDepth":197,"depth":211,"links":546},[547,548],{"id":181,"depth":211,"text":182},{"id":300,"depth":211,"text":301},"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.","md",null,{},true,{"title":128,"description":549},{"loc":129,"lastmod":556},"2026-11-21T15:24:08+01:00","jAFelC35FQY-p-YNOMMM0LMrIu36FWoG25Be7tbdv1Y",[559,561],{"title":124,"path":125,"stem":126,"description":560,"children":-1},"php artisan access:check builds every control and reports in CI what would throw, open or hide rows, or leave search documents stale.",{"title":132,"path":133,"stem":134,"description":562,"children":-1},"make:control and make:perimeter scaffold the controls and the perimeter classes, from stubs that you can publish and change.",1795277181805]