1.7 KiB
1.7 KiB
Integrating iriks-it/laravel-manager (guide for AI agents)
Goal: the manager runs in this Laravel app and php artisan manager:doctor is green. Do the steps in order and
never edit files inside vendor/.
composer require iriks-it/laravel-manager- Pick the modules.
usersandmediaare on;pages,postsdefault on;reviews,audit,statisticsdefault 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"(writesMANAGER_*to.env, publishesconfig/manager.php, runs the doctor). Add--path=adminto move the URL.- Add the trait to the user model:
use \IriksIT\Manager\Concerns\HasManagerAccess;. Never putis_super_adminin$fillable. php artisan migrate(a new process, so it sees the switches you wrote in step 3).- Create the first super admin:
php artisan manager:create-user --name="..." --email="..." --password="<12+ chars>". - Run
php artisan manager:doctor --json. Every check must beokor an understoodwarn; eachfail/warnhas afix. Repeat until"ok": true.
Facts that matter:
- The manager lives at
/manager(MANAGER_PATH) behindweb+auth(manager.middleware); the app needs a route namedlogin. - Anything that is off has no routes, tables or permissions. A module that needs another one fails at boot when that one is off.
- Answers are JSON. 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.