Skip to content

Commit

Permalink
Add create:migration console command documentation (#165)
Browse files Browse the repository at this point in the history
  • Loading branch information
mjauvin committed Nov 1, 2023
1 parent bb986de commit 7f88b8a
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions console/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ Command | Description
[`create:controller`](../console/scaffolding#create-a-backend-controller) | Create a Controller in a plugin.
[`create:formwidget`](../console/scaffolding#create-a-form-widget) | Create a FormWidget in a plugin.
[`create:job`](../console/scaffolding#create-a-job) | Create a Job class in a plugin.
[`create:migration`](../console/scaffolding#create-a-migration) | Create a Migration in a plugin.
[`create:model`](../console/scaffolding#create-a-model) | Create a Model in a plugin.
[`create:plugin`](../console/scaffolding#create-a-plugin) | Create a Plugin.
[`create:reportwidget`](../console/scaffolding#create-a-report-widget) | Create a ReportWidget in a plugin.
Expand Down
20 changes: 20 additions & 0 deletions console/scaffolding.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,26 @@ php artisan create:component <plugin code> <component name>

The `create:component` command creates a new component class and the default component view. The first argument specifies the plugin code of the plugin that this component will be added into, and the second parameter specifies the component class name, eg. `MyComponent`.

## Create a migration

The `create:migration` command generates the migration file needed for a model database. The first argument specifies the plugin code of the plugin that this migration will be added into. Without any options, a bare migration file gets generated.

```bash
php artisan create:migration <plugin code>
```

In order to create a migration that auto-populates columns for your model, use the `--create` and `--model` options:

```bash
php artisan create:migration <plugin code> --create --model YourModel
```

In order to create an "update" migration, use the `--update` and `--model` options:

```bash
php artisan create:migration <plugin code> --update --model YourModel
```

## Create a model

```bash
Expand Down

0 comments on commit 7f88b8a

Please sign in to comment.