Skip to content

Commit

Permalink
docs: write docs
Browse files Browse the repository at this point in the history
  • Loading branch information
regnerisch committed May 25, 2024
1 parent 8a660f0 commit 2ab248f
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 7 deletions.
4 changes: 2 additions & 2 deletions docs/commands/make-action.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# `beyond:make:action`
Creates a new action. An action does run one specific task, e.g. storing or updating a model.
If you need to do additional tasks like logging you should wrap those inside their own action
or (maybe better) consider using a [process](make-process.md).
If you need to do additional tasks like sending e-mails you should wrap those inside their
own action or (maybe better) consider using a [process](make-process.md).

## Signature
`beyond:make:action {name} {--force}`
Expand Down
6 changes: 3 additions & 3 deletions docs/commands/make-builder.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ Creates a new Laravel Eloquent builder for a model.
> [!NOTE]
> You need to add the builder to your model
> ```
> public function newEloquentBuilder($q): YourBuilder
> public function newEloquentBuilder($query): Builder
> {
> return new YourBuilder($q);
> return new UserBuilder($query);
> }
> ```
> [!NOTE]
> For proper IDE support add the following docblock to you model
> ```
> /**
> * @method static YourBuilder query()
> * @method static UserBuilder query()
> */
> class User extends Model
> ```
Expand Down
4 changes: 2 additions & 2 deletions docs/commands/make-collection.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ Creates a new Laravel collection for a model.
> [!NOTE]
> You need to add the collection to your model
> ```
> public function newCollection($q): YourCollection
> public function newCollection(array $models = []): Collection
> {
> return new YourCollection($q);
> return new UserCollection($models);
> }
> ```
Expand Down
16 changes: 16 additions & 0 deletions docs/commands/make-process.md
Original file line number Diff line number Diff line change
@@ -1 +1,17 @@
# `beyond:make:process`
Creates a new process. A process is made up of one or more actions and produces the desired
result. A process for creating the user would look like this, for example: Validate the request,
create the user, send an e-mail, send a notification to the administrator. This process is
individual for each application, e.g. the process in the administration application could
dispense with sending the notification to the administrator.

## Signature
`beyond:make:process {name} {--force}`

| Parameters | Description |
|------------|-------------------------|
| name | The name of you process |

| Flags | Description |
|---------|-------------------------|
| --force | Overwrite existing file |

0 comments on commit 2ab248f

Please sign in to comment.