PHPackages                             webrium/console - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [CLI &amp; Console](/categories/cli)
4. /
5. webrium/console

ActiveLibrary[CLI &amp; Console](/categories/cli)

webrium/console
===============

2.2.4(6d ago)017511PHP

Since Jul 31Pushed 6d agoCompare

[ Source](https://github.com/webrium/console)[ Packagist](https://packagist.org/packages/webrium/console)[ RSS](/packages/webrium-console/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (10)Dependencies (10)Versions (36)Used By (1)

Webrium Console
===============

[](#webrium-console)

A command-line toolkit for the [Webrium](https://github.com/webrium) PHP framework. Provides commands for scaffolding files, managing databases, inspecting logs, and installing plugins.

Requirements
------------

[](#requirements)

- PHP 8.1+
- Symfony Console 6.4+

Installation
------------

[](#installation)

```
composer require webrium/console
```

---

Available Commands
------------------

[](#available-commands)

CommandDescription`init`Create the project directory structure`make:model`Generate a model file`make:controller`Generate a controller file`make:route`Generate a route file`make:migration`Generate a database migration file`make:seeder`Generate a database seeder file`migrate`Run, roll back, or inspect database migrations`db:seed`Run database seeders`call`Call a method on a controller or model`db`Manage databases`table`Manage database tables and execute SQL files`log`Manage log files`plugin:install`Install a plugin`plugin:update`Update an installed plugin`plugin:remove`Remove an installed plugin`plugin:list`List installed plugins`plugin:info`Preview a plugin without installing---

`init`
------

[](#init)

Creates all standard Webrium project directories.

```
php webrium init
```

---

`make:model`
------------

[](#makemodel)

Generates a model file in the models directory. Without `--table`, creates a simple model. With `--table`, creates a database-connected model.

```
php webrium make:model  [--table=] [--no-plural] [--force]
```

Argument / OptionDescription`Name`Model class name (e.g. `User`)`--table, -t`Database table name. If omitted, the name is auto-converted to snake\_case and pluralized`--no-plural`Prevent automatic pluralization of the table name`--force, -f`Overwrite if the file already exists```
# DB model with explicit table name
php webrium make:model User --table=users

# DB model — table name auto-generated as "users"
php webrium make:model User -t

# Simple model (no DB)
php webrium make:model UserHelper

# DB model — table stays "status" instead of "statuses"
php webrium make:model Status -t --no-plural
```

---

`make:controller`
-----------------

[](#makecontroller)

Generates a controller file in the controllers directory. Automatically appends `Controller` to the name if not already present.

```
php webrium make:controller  [--namespace=] [--force]
```

Argument / OptionDescription`Name`Controller name (e.g. `User` → `UserController`)`--namespace`Custom namespace (default: `App\Controllers`)`--force, -f`Overwrite if the file already exists```
php webrium make:controller User
php webrium make:controller Admin --namespace="App\Controllers\Admin"
```

---

`make:route`
------------

[](#makeroute)

Generates a route file in the routes directory.

```
php webrium make:route  [--force]
```

Argument / OptionDescription`Name`Route file name (e.g. `Api` → `Api.php`)`--force, -f`Overwrite if the file already exists```
php webrium make:route Api
php webrium make:route Web --force
```

---

`make:migration`
----------------

[](#makemigration)

Generates a timestamped migration file in `database/migrations`. Builds on top of [`webrium/foxdb`](https://github.com/webrium/foxdb)'s migration system (`Foxdb\Migrations\Migration`, `Schema`, `Blueprint`).

```
php webrium make:migration  [--table=] [--force]
```

Argument / OptionDescription`name`Migration name, e.g. `create_posts_table` or `add_status_to_posts_table``--table, -t`Explicit table name. If omitted, it's inferred from the migration name`--force, -f`Allow generating another migration with the same descriptive nameThe generated stub depends on the naming convention used:

- **`create_..._table`** → uses the *create* stub, with `Schema::create()` already wired up and a ready-to-run `id()` + `timestamps()` example.
- **`add_..._to_..._table`** / **`remove_..._from_..._table`** → uses the *update* stub, with an empty `Schema::table()` block in both `up()` and `down()` for you to fill in.
- Anything else falls back to the *create* stub.

In every case the table name is inferred automatically from the migration name, unless `--table` is given explicitly.

```
# Create stub — Schema::create('posts', ...) is pre-filled
php webrium make:migration create_posts_table

# Update stub — Schema::table('posts', ...) with an empty body
php webrium make:migration add_status_to_posts_table
php webrium make:migration remove_legacy_id_from_posts_table

# Explicit table name, useful when the migration name doesn't follow either convention
php webrium make:migration setup_indexes --table=posts

# Allow a duplicate descriptive name (creates a second, separately timestamped file)
php webrium make:migration create_posts_table --force
```

---

`migrate`
---------

[](#migrate)

Runs database migrations from `database/migrations` using [`webrium/foxdb`](https://github.com/webrium/foxdb)'s `Migrator`. Tracks applied migrations in a `migrations` table, batched the same way per run so a whole batch can be rolled back together.

```
php webrium migrate [] [--step=] [--connection=] [--force]
```

ActionDescription`run` *(default)*Apply all pending migrations`rollback`Roll back the last batch (or `--step` migrations)`reset`Roll back every migration that has been run`refresh`Roll back everything, then run all migrations again`status`Show which migrations have run, and in which batchOptionDescription`--step`Limit `run`/`rollback` to a specific number of migrations`--connection, -c`Run against a named connection instead of the default one`--seed`After a successful `run` or `refresh`, also run every seeder in `database/seeders``--force, -f`Skip the confirmation prompt for `reset`/`refresh````
# Apply all pending migrations
php webrium migrate
php webrium migrate run

# Show migration status
php webrium migrate status

# Roll back the most recent batch
php webrium migrate rollback

# Roll back only the last 2 migrations
php webrium migrate rollback --step=2

# Roll back everything, with confirmation
php webrium migrate reset

# Roll back everything, skipping the confirmation prompt
php webrium migrate reset --force

# Roll back and re-run all migrations
php webrium migrate refresh --force

# Run against a non-default connection
php webrium migrate --connection=secondary

# Apply pending migrations, then run all seeders
php webrium migrate --seed

# Reset, re-run, and re-seed in one command
php webrium migrate refresh --seed --force
```

Each migration runs inside its own database transaction. If a migration fails, `migrate` stops and reports it — earlier migrations in the same run stay applied, matching the underlying `Migrator::run()` behavior.

---

`make:seeder`
-------------

[](#makeseeder)

Generates a seeder class in `database/seeders`. Seeders populate the database with default or test data (admin users, lookup tables, categories, etc.) and are built on top of [`webrium/foxdb`](https://github.com/webrium/foxdb)'s `Foxdb\Seeders\Seeder` base class.

```
php webrium make:seeder  [--force]
```

Argument / OptionDescription`Name`Seeder class name (e.g. `UsersSeeder`). Auto-converted to PascalCase if given in snake\_case`--force, -f`Overwrite if the file already exists```
php webrium make:seeder UsersSeeder
php webrium make:seeder roles_seeder        # generated as RolesSeeder.php
php webrium make:seeder UsersSeeder --force
```

The generated stub looks like:

```
