Hex CLI

HexPHP includes a native, lightweight command-line interface designed to speed up your workflow and manage database migrations directly from the terminal.

Available Commands

You can run these commands from the root directory of your project using php hex.

php hex make:controller Name

Generates a new controller class in app/Controllers/.

php hex make:model Name

Generates a new Eloquent model class in app/Models/.

php hex make:component name

Generates a new UI component stub in app/Components/.

php hex create:role name

Creates a new explicit database role within the roles table (great for setting up custom RBAC access natively from the terminal.)

php hex make:migration create_table_name

Generates an anonymous migration class stub in database/migrations/.

php hex migrate

Connects to your dual-connection database configuration and securely triggers any pending up() migration methods.