PR CI / flow (pull_request) Successful in 4s
PR CI / ledger (pull_request) Successful in 8s
PR CI / test (stable) (pull_request) Successful in 46s
PR CI / test (lowest) (pull_request) Successful in 48s
PR CI / ui (pull_request) Successful in 52s
PR CI / security (pull_request) Successful in 55s
PR CI / pr-ci (pull_request) Successful in 1s
PR CI / release-automerge (pull_request) Successful in 4s
2.8 KiB
2.8 KiB
Integrating iriks-it/laravel-manager (guide for AI agents)
Goal: the manager runs in this Laravel app and php artisan manager:doctor --json says "ok": true. Do the steps in
order and never edit files inside vendor/.
composer require iriks-it/laravel-manager(A version that is not on Packagist yet: firstcomposer config repositories.manager --json '{"type":"path","url":"/path/to/laravel-manager","options":{"symlink":false}}', then require@dev.)- Pick the modules.
usersandmediaare on;pagesandpostsare on by default;reviews,auditandstatisticsare off (audit and statistics store visitor data: only switch them on when the owner says so). php artisan manager:install --modules=users,media,posts --user-model="App\Models\User"It writes theMANAGER_*switches to.envand publishesconfig/manager.php. Add--path=adminto move the URL. It does not run the check itself (this process still has the old config): that is step 7.- Add the trait to the user model:
use \IriksIT\Manager\Concerns\HasManagerAccess;. Never putis_super_adminin$fillable. php artisan config:clear && php artisan migrate && php artisan storage:link(a new process, so it sees the switches of step 3).- Create the first super admin:
php artisan manager:create-user --name="..." --email="..." --password="<12+ chars>". php artisan manager:doctor --json. Every check must beokor an understoodwarn; eachfailandwarnhas afix. Repeat until"ok": true.
Facts that matter:
- The screens are part of the package (
MANAGER_UI=package, the default): open/managerin a browser. The app does not need a login of its own: when it has no route namedlogin, the manager's own login at/manager/loginis used. WithMANAGER_UI=nonethere are only the JSON routes. - A browser address gets the screens, a request with
Accept: application/jsongets the data. To call the JSON routes from a script:GET /manager/loginonce for theXSRF-TOKENcookie, thenPOST /manager/loginwith headerX-XSRF-TOKEN(the cookie value, URL-decoded),Accept: application/jsonand body{"email": "...", "password": "..."}; the answer is{"redirect": "/manager"}. - The look:
MANAGER_THEME=dark|lightor your own (php artisan manager:make-theme acme --brand=#e4002b --name="Acme" --logo=/img/logo.svg, thenMANAGER_THEME=acme). Each account can pick its own in its profile (MANAGER_USER_THEMES=falsestops that). - Anything that is off has no routes, tables or permissions. A module that needs another one fails at boot when that one is off.
- Do not add site-specific code to the package: a site's own part is its own module class (
Contracts\Module, extendModules\BaseModule, add it tomanager.available). - Behind a proxy set trusted proxies before switching
auditon.