CLI Commands
This page lists every command you need to install, develop, and operate Marketix — from the Composer convenience scripts through the custom marketix:* Artisan commands to the standard Laravel commands operators use in production.
Docker users run php artisan commands inside the app container:
docker compose exec app php artisan <command>Composer scripts
Section titled “Composer scripts”These scripts are defined in composer.json and wrap the most common multi-step workflows.
| Script | Invocation | What it does |
|---|---|---|
setup | composer run setup | Full first-time setup: installs PHP dependencies, copies .env.example → .env if missing, generates APP_KEY, runs migrations, installs Node dependencies, and builds frontend assets. |
dev | composer run dev | Local development server: starts php artisan serve, queue:listen, pail (log tail), and npm run dev (Vite HMR) concurrently via concurrently. |
test | composer run test | Clears the config cache, then runs the PHPUnit test suite via php artisan test. |
Custom Artisan commands
Section titled “Custom Artisan commands”marketix:create-admin
Section titled “marketix:create-admin”Creates a new super-admin user, or promotes an existing user to super admin.
php artisan marketix:create-admin [options]Options
| Option | Description |
|---|---|
--name= | Admin display name. Prompted interactively if omitted. |
--email= | Admin email address. Prompted interactively if omitted. |
--password= | Admin password. Prompted securely (with confirmation) if omitted. |
--force | Skip the confirmation prompt when promoting an existing user. |
Behavior
- If a user with the given email already exists, the command promotes them to super admin. It never resets their existing password.
- If no user exists, it creates a new user with the supplied credentials and the
super_adminflag set. - If the email already belongs to a super admin, the command exits successfully with no changes.
See First Run for the walkthrough of creating your first admin after installation.
marketix:geoip:update
Section titled “marketix:geoip:update”Downloads the MaxMind GeoLite2-City database and saves it to storage/app/geoip/GeoLite2-City.mmdb.
php artisan marketix:geoip:updateRequires MAXMIND_LICENSE_KEY to be set (see Environment Variables). The database is approximately 60 MB; the command temporarily raises the PHP memory limit to 512 MB for extraction.
This command runs automatically via the scheduler every day. See Operations for setup instructions.
marketix:geoip:test
Section titled “marketix:geoip:test”Looks up a single IP address against the local GeoLite2 database and prints the result as a table.
php artisan marketix:geoip:test {ip}Arguments
| Argument | Description |
|---|---|
ip | The IP address to look up (IPv4 or IPv6). |
Returns country, region, city, and related fields. If the database is not present, the command instructs you to run marketix:geoip:update first. A missing city is expected for datacenter, VPN, and anycast ranges — the GeoLite2 free database frequently resolves these to country level only.
marketix:demo:setup
Section titled “marketix:demo:setup”Resets the database and seeds demo users, projects, domains, and short links. Destructive — runs migrate:fresh against the configured database.
php artisan marketix:demo:setup [--force]Options
| Option | Description |
|---|---|
--force | Skip the interactive “Are you sure?” prompt (which otherwise requires typing yes). |
Standard Laravel / Horizon / Octane commands
Section titled “Standard Laravel / Horizon / Octane commands”These are standard framework commands operators commonly need. Refer to the Laravel, Horizon, and Octane documentation for full option references.
Database
Section titled “Database”# Run pending migrationsphp artisan migrate
# Fresh install (drops all tables then re-migrates — DESTRUCTIVE)php artisan migrate:freshQueue (Horizon)
Section titled “Queue (Horizon)”# Start Horizon (manages all queue workers)php artisan horizon
# Pause all Horizon workersphp artisan horizon:pause
# Resume paused workersphp artisan horizon:continue
# Graceful shutdown (let running jobs finish)php artisan horizon:terminateScheduler
Section titled “Scheduler”# Run the scheduler (typically via a cron entry calling this every minute)php artisan schedule:run
# List all scheduled tasks and their next run timephp artisan schedule:listThe following tasks are scheduled automatically:
| Task | Frequency |
|---|---|
marketix:geoip:update | Daily |
activitylog:clean | Daily |
| Domain status check | Every 15 minutes |
Octane
Section titled “Octane”# Start the Octane serverphp artisan octane:start
# Reload workers (zero-downtime deploy)php artisan octane:reload
# Stop the Octane serverphp artisan octane:stop
# Show current server statusphp artisan octane:statusCache and config
Section titled “Cache and config”# Cache config, routes, views, and events for productionphp artisan optimize
# Clear all cachesphp artisan optimize:clear
# Cache config onlyphp artisan config:cache
# Clear config cachephp artisan config:clear