Skip to content

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:

Terminal window
docker compose exec app php artisan <command>

These scripts are defined in composer.json and wrap the most common multi-step workflows.

ScriptInvocationWhat it does
setupcomposer run setupFull first-time setup: installs PHP dependencies, copies .env.example.env if missing, generates APP_KEY, runs migrations, installs Node dependencies, and builds frontend assets.
devcomposer run devLocal development server: starts php artisan serve, queue:listen, pail (log tail), and npm run dev (Vite HMR) concurrently via concurrently.
testcomposer run testClears the config cache, then runs the PHPUnit test suite via php artisan test.

Creates a new super-admin user, or promotes an existing user to super admin.

Terminal window
php artisan marketix:create-admin [options]

Options

OptionDescription
--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.
--forceSkip 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_admin flag 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.


Downloads the MaxMind GeoLite2-City database and saves it to storage/app/geoip/GeoLite2-City.mmdb.

Terminal window
php artisan marketix:geoip:update

Requires 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.


Looks up a single IP address against the local GeoLite2 database and prints the result as a table.

Terminal window
php artisan marketix:geoip:test {ip}

Arguments

ArgumentDescription
ipThe 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.


Resets the database and seeds demo users, projects, domains, and short links. Destructive — runs migrate:fresh against the configured database.

Terminal window
php artisan marketix:demo:setup [--force]

Options

OptionDescription
--forceSkip 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.

Terminal window
# Run pending migrations
php artisan migrate
# Fresh install (drops all tables then re-migrates — DESTRUCTIVE)
php artisan migrate:fresh
Terminal window
# Start Horizon (manages all queue workers)
php artisan horizon
# Pause all Horizon workers
php artisan horizon:pause
# Resume paused workers
php artisan horizon:continue
# Graceful shutdown (let running jobs finish)
php artisan horizon:terminate
Terminal window
# Run the scheduler (typically via a cron entry calling this every minute)
php artisan schedule:run
# List all scheduled tasks and their next run time
php artisan schedule:list

The following tasks are scheduled automatically:

TaskFrequency
marketix:geoip:updateDaily
activitylog:cleanDaily
Domain status checkEvery 15 minutes
Terminal window
# Start the Octane server
php artisan octane:start
# Reload workers (zero-downtime deploy)
php artisan octane:reload
# Stop the Octane server
php artisan octane:stop
# Show current server status
php artisan octane:status
Terminal window
# Cache config, routes, views, and events for production
php artisan optimize
# Clear all caches
php artisan optimize:clear
# Cache config only
php artisan config:cache
# Clear config cache
php artisan config:clear