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 d622a58 commit 8a660f0
Show file tree
Hide file tree
Showing 7 changed files with 113 additions and 115 deletions.
118 changes: 3 additions & 115 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,121 +38,9 @@ Register the namespaces inside your `composer.json`:
```
Run `composer dump-autoload` and everything is set up for using Laravel Beyond commands.

## Commands
### Overview
#### Application
- [`beyond:make:command`](#beyondmakecommand)
- `beyond:make:controller`
- `beyond:make:policy`
- `beyond:make:process`
- `beyond:make:query`
- `beyond:make:request`
- `beyond:make:resource`
- `beyond:make:rule`

#### Domain
- [`beyond:make:action`](#beyondmakeaction)
- [`beyond:make:builder`](#beyondmakebuilder)
- [`beyond:make:collection`](#beyondmakecollection)
- `beyond:make:data`
- `beyond:make:enum`
- `beyond:make:event`
- `beyond:make:job`
- `beyond:make:listener`
- `beyond:make:model`
- `beyond:make:observer`

### Detail
#### `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.

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

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

| Flags | Description |
|---------|-------------------------|
| --force | Overwrite existing file |
---
#### `beyond:make:builder`
Creates a new Laravel Eloquent builder for a model.

> [!NOTE]
> You need to add the builder to your model
> ```
> public function newEloquentBuilder($q): YourBuilder
> {
> return new YourBuilder($q);
> }
> ```
> [!NOTE]
> For proper IDE support add the following docblock to you model
> ```
> /**
> * @method static YourBuilder query()
> */
> class User extends Model
> ```
##### Signature
`beyond:make:builder {name} {--force}`

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

| Flags | Description |
|---------|-------------------------|
| --force | Overwrite existing file |
---
#### `beyond:make:collection`
Creates a new Laravel collection for a model.

> [!NOTE]
> You need to add the collection to your model
> ```
> public function newCollection($q): YourCollection
> {
> return new YourCollection($q);
> }
> ```
##### Signature
`beyond:make:collection {name} {--force}`

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

| Flags | Description |
|---------|-------------------------|
| --force | Overwrite existing file |
---
#### `beyond:make:command`
Creates a new Laravel command.

> [!NOTE]
> You need to add the command at `App\Console\Kernel`.
##### Signature
`beyond:make:command {name} {--command=command:name} {--force}`

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

| Flags | Description |
|-----------|-------------------------|
| --command | Define the command name |
| --force | Overwrite existing file |
---

## Documentation
Take a look at our documentation inside [`/docs`](docs/README.md) to learn about the available
commands and how to use them.

## Directory structure
```
Expand Down
24 changes: 24 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Documentation

## Commands
### Application
- [`beyond:make:command`](commands/make-command.md)
- `beyond:make:controller`
- `beyond:make:policy`
- `beyond:make:process`
- `beyond:make:query`
- `beyond:make:request`
- `beyond:make:resource`
- `beyond:make:rule`

### Domain
- [`beyond:make:action`](commands/make-action.md)
- [`beyond:make:builder`](commands/make-builder.md)
- [`beyond:make:collection`](commands/make-collection.md)
- `beyond:make:data`
- `beyond:make:enum`
- `beyond:make:event`
- `beyond:make:job`
- `beyond:make:listener`
- `beyond:make:model`
- `beyond:make:observer`
15 changes: 15 additions & 0 deletions docs/commands/make-action.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# `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).

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

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

| Flags | Description |
|---------|-------------------------|
| --force | Overwrite existing file |
31 changes: 31 additions & 0 deletions docs/commands/make-builder.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# `beyond:make:builder`
Creates a new Laravel Eloquent builder for a model.

> [!NOTE]
> You need to add the builder to your model
> ```
> public function newEloquentBuilder($q): YourBuilder
> {
> return new YourBuilder($q);
> }
> ```
> [!NOTE]
> For proper IDE support add the following docblock to you model
> ```
> /**
> * @method static YourBuilder query()
> */
> class User extends Model
> ```
## Signature
`beyond:make:builder {name} {--force}`

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

| Flags | Description |
|---------|-------------------------|
| --force | Overwrite existing file |
22 changes: 22 additions & 0 deletions docs/commands/make-collection.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# `beyond:make:collection`
Creates a new Laravel collection for a model.

> [!NOTE]
> You need to add the collection to your model
> ```
> public function newCollection($q): YourCollection
> {
> return new YourCollection($q);
> }
> ```
## Signature
`beyond:make:collection {name} {--force}`

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

| Flags | Description |
|---------|-------------------------|
| --force | Overwrite existing file |
17 changes: 17 additions & 0 deletions docs/commands/make-command.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# `beyond:make:command`
Creates a new Laravel command.

> [!NOTE]
> You need to add the command at `App\Console\Kernel`.
## Signature
`beyond:make:command {name} {--command=command:name} {--force}`

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

| Flags | Description |
|-----------|-------------------------|
| --command | Define the command name |
| --force | Overwrite existing file |
1 change: 1 addition & 0 deletions docs/commands/make-process.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# `beyond:make:process`

0 comments on commit 8a660f0

Please sign in to comment.