A standalone maintenance panel for Forge projects deployed on shared hosting where you don't have CLI access.
Forge provides CLI commands for cache management, migrations, and seeders. That works fine when you have terminal access. On shared hosting — where you upload files via FTP or a file manager — those commands aren't available. This script fills that gap.
It's a single PHP file that boots the Forge kernel, gives you a web interface for common maintenance tasks, and can be deleted when you're done.
- Copy
setup.phpinto your project'spublic/directory. - Visit
https://yoursite.com/setup.phpin your browser. - Set a password on first visit. You'll get an access token — save it somewhere.
- Use the panel to perform maintenance.
- Click "Delete setup.php" when you're finished.
After you delete it, nothing remains. The only other file it creates is .setup_lock in the project root, which is also removed during self-destruct.
- Warm All Caches — rebuilds the module registry, compiles lifecycle hooks, runs all cache warmers (controller map, router hooks, role permissions), rebuilds the helper map and module command cache.
- Flush All Caches — clears all framework cache files, view templates, role/permission caches, and module caches. Everything rebuilds lazily on the next request.
- Clear View Cache — removes compiled view templates only.
- Reset OPcache — resets the OPcache when the extension is available.
- Individual cache files — clear specific cache files (module registry, compiled hooks, controller map, etc.) one at a time.
- Preview — list pending migrations without running them. Filter by scope (app, module, all) and optionally by module name or group.
- Run — execute pending migrations.
- Rollback — roll back by number of steps or by batch number.
- Preview — list available seeders and whether they've been run.
- Run — execute pending seeders for app or a specific module.
- Rollback — roll back seeders by number of steps.
- Generate Application Key — creates a new key and writes it to
.env. - Toggle Maintenance Mode — creates or removes the maintenance file.
- Clear Logs — removes all files in
storage/logs/. - Fix Permissions — sets
0755on storage directories. - Reset OPcache — same as the cache tab option.
The panel is protected by a password set on first visit. The password is bcrypt-hashed and stored in .setup_lock in the project root. All actions are rate-limited to 30 per minute and logged to storage/logs/setup.log.
When you're done, use the self-destruct button. It removes both setup.php and .setup_lock.
- PHP 8.1+
- The Forge kernel and modules must be present (this script boots the full kernel)
- A working database connection if you're running migrations or seeders
- The
.htaccessinpublic/should already skip this file since it checks for existing files before rewriting. If your server routes it throughindex.phpanyway, add a rewrite condition forsetup.php. - The file is not meant to stay deployed. Use it, do your maintenance, delete it.
- This is not a replacement for proper CLI access. It's a fallback for when you don't have it.