Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Gaal committed Jan 22, 2024
1 parent fb37108 commit dc5496a
Show file tree
Hide file tree
Showing 17 changed files with 327 additions and 16 deletions.
27 changes: 26 additions & 1 deletion docs/_sidebar.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,30 @@
* Getting Started
* [Installation](installation.md)
* Structure
* [Upgrade Guide](upgrade.md)
* Roadmap
* Commands
* [MakeActionCommand](make-action-command.md)
* [Action](commands/action.md)
* [Builder](commands/builder.md)
* [Collection](commands/collection.md)
* [Command](commands/command.md)
* [Controller](commands/controller.md)
* Data
* Enum
* Event
* Job
* Listener
* Middleware
* Migration
* Model
* Module
* Notification
* Observer
* Policy
* Process
* Query
* Request
* Resource
* Rule
* ServiceProvider
* Test
4 changes: 2 additions & 2 deletions docs/make-action-command.md → docs/commands/action.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# MakeActionCommand
# Action
Creates a new action class inside the given module.

> Actions will be placed in `modules/{Module}/Domain/Actions`
Expand All @@ -10,7 +10,7 @@ php artisan beyond:make:action User.CreateUserAction
```

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

### Flags
| Name | Short | Description | Example |
Expand Down
20 changes: 20 additions & 0 deletions docs/commands/builder.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Builder
Creates a new eloquent builder inside the given module.

> Builders will be placed in `modules/{Module}/Domain/Builders`
## Usage
```bash
php artisan beyond:make:builder User.Admin/UserAdminBuilder
php artisan beyond:make:builder User.UserBuilder
```

### Command
`beyond:make:builder {name} {--force}`

### Flags
| Name | Short | Description | Example |
|---------|-------|--------------------------|---------|
| --force | | Overwrites existing file | |


21 changes: 21 additions & 0 deletions docs/commands/collection.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Collection
Creates a new collection inside the given module.

> Collections will be placed in `modules/{Module}/Domain/Collections`
## Usage
```bash
php artisan beyond:make:collection User.Admin/UserAdminCollection
php artisan beyond:make:collection User.UserCollection
```

### Command
`beyond:make:collection {name} {--model=} {--force}`

### Flags
| Name | Short | Description | Example |
|---------|-------|----------------------------------|---------|
| --model | | Adds the model to the collection | User |
| --force | | Overwrites existing file | |


21 changes: 21 additions & 0 deletions docs/commands/command.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Command
Creates a new command inside the given module.

> Commands will be placed in `modules/{Module}/App/Commands`
## Usage
```bash
php artisan beyond:make:command User.Admin/SyncAdminCommand
php artisan beyond:make:command User.PurgeInactiveUsersCommand
```

### Command
`beyond:make:command {name} {--command=command:name} {--force}`

### Flags
| Name | Short | Description | Example |
|-----------|-------|--------------------------|--------------|
| --command | | Defines the CLI command | command:name |
| --force | | Overwrites existing file | |


22 changes: 22 additions & 0 deletions docs/commands/controller.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Controller
Creates a new controller inside the given module.

> Controllers will be placed in `modules/{Module}/App/Controllers`
## Usage
```bash
php artisan beyond:make:controller User.Admin/UserAdminController
php artisan beyond:make:controller User.UserController
```

### Command
`beyond:make:controller {name} {--api} {--i|invokable} {--force}`

### Flags
| Name | Short | Description | Example |
|-------------------|-------|----------------------------------|---------|
| --api | | Creates a API controller | |
| --i / --invokable | | Creates an invokable controller | |
| --force | | | |


18 changes: 5 additions & 13 deletions docs/installation.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,12 @@
# Installation
It's recommended to install `laravel-beyond` with [composer](https://getcomposer.org).
It's recommended to install Laravel Beyond with [composer](https://getcomposer.org).

```bash
composer require --dev akrillia/laravel-beyond
```

## Requirements

### v7.x
| Package | Version |
|---------|---------|
| php | ^8.2 |
| Laravel | ^10.x |

### v6.x
| Package | Version |
|---------|-------------|
| php | ^8.1 |
| Laravel | ^9.x\|^10.x |
| Version | PHP | Laravel |
|---------|------|--------------|
| 7.x | ^8.2 | ^10.x |
| 6.x | ^8.1 | ^9.x / ^10.x |
21 changes: 21 additions & 0 deletions tests/DocumentationTest/ActionTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

namespace Tests\DocumentationTest;

use Tests\TestCase;

class ActionTest extends TestCase
{
protected string $path = '/docs/commands/action.md';

public function testCorrectDocumentation(): void
{
$file = beyond_path() . $this->path;
$contents = file_get_contents($file);

$this->assertFileExists($file);
$this->assertStringContainsString('# Action', $contents);
$this->assertStringContainsString('modules/{Module}/Domain/Actions', $contents);
$this->assertStringContainsString('beyond:make:action {name} {--force}', $contents);
}
}
21 changes: 21 additions & 0 deletions tests/DocumentationTest/BuilderTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

namespace Tests\DocumentationTest;

use Tests\TestCase;

class BuilderTest extends TestCase
{
protected string $path = '/docs/commands/builder.md';

public function testCorrectDocumentation(): void
{
$file = beyond_path() . $this->path;
$contents = file_get_contents($file);

$this->assertFileExists($file);
$this->assertStringContainsString('# Builder', $contents);
$this->assertStringContainsString('modules/{Module}/Domain/Builders', $contents);
$this->assertStringContainsString('beyond:make:builder {name} {--force}', $contents);
}
}
21 changes: 21 additions & 0 deletions tests/DocumentationTest/CollectionTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

namespace Tests\DocumentationTest;

use Tests\TestCase;

class CollectionTest extends TestCase
{
protected string $path = '/docs/commands/collection.md';

public function testCorrectDocumentation(): void
{
$file = beyond_path() . $this->path;
$contents = file_get_contents($file);

$this->assertFileExists($file);
$this->assertStringContainsString('# Collection', $contents);
$this->assertStringContainsString('modules/{Module}/Domain/Collections', $contents);
$this->assertStringContainsString('beyond:make:collection {name} {--model=} {--force}', $contents);
}
}
21 changes: 21 additions & 0 deletions tests/DocumentationTest/CommandTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

namespace Tests\DocumentationTest;

use Tests\TestCase;

class CommandTest extends TestCase
{
protected string $path = '/docs/commands/command.md';

public function testCorrectDocumentation(): void
{
$file = beyond_path() . $this->path;
$contents = file_get_contents($file);

$this->assertFileExists($file);
$this->assertStringContainsString('# Command', $contents);
$this->assertStringContainsString('modules/{Module}/App/Commands', $contents);
$this->assertStringContainsString('beyond:make:command {name} {--command=command:name} {--force}', $contents);
}
}
21 changes: 21 additions & 0 deletions tests/DocumentationTest/ControllerTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

namespace Tests\DocumentationTest;

use Tests\TestCase;

class ControllerTest extends TestCase
{
protected string $path = '/docs/commands/controller.md';

public function testCorrectDocumentation(): void
{
$file = beyond_path() . $this->path;
$contents = file_get_contents($file);

$this->assertFileExists($file);
$this->assertStringContainsString('# Controller', $contents);
$this->assertStringContainsString('modules/{Module}/App/Controllers', $contents);
$this->assertStringContainsString('beyond:make:controller {name} {--api} {--i|invokable} {--force}', $contents);
}
}
21 changes: 21 additions & 0 deletions tests/DocumentationTest/DataObjectTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

namespace Tests\DocumentationTest;

use Tests\TestCase;

class DataObjectTest extends TestCase
{
protected string $path = '/docs/commands/data-object.md';

public function testCorrectDocumentation(): void
{
$file = beyond_path() . $this->path;
$contents = file_get_contents($file);

$this->assertFileExists($file);
$this->assertStringContainsString('# Data Object', $contents);
$this->assertStringContainsString('modules/{Module}/Domain/DataObjects', $contents);
$this->assertStringContainsString('beyond:make:data {name} {--force}', $contents);
}
}
21 changes: 21 additions & 0 deletions tests/DocumentationTest/EnumTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

namespace Tests\DocumentationTest;

use Tests\TestCase;

class EnumTest extends TestCase
{
protected string $path = '/docs/commands/enum.md';

public function testCorrectDocumentation(): void
{
$file = beyond_path() . $this->path;
$contents = file_get_contents($file);

$this->assertFileExists($file);
$this->assertStringContainsString('# Enum', $contents);
$this->assertStringContainsString('modules/{Module}/Domain/Enum', $contents);
$this->assertStringContainsString('beyond:make:enum {name} {--force}', $contents);
}
}
21 changes: 21 additions & 0 deletions tests/DocumentationTest/EventTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

namespace Tests\DocumentationTest;

use Tests\TestCase;

class EventTest extends TestCase
{
protected string $path = '/docs/commands/event.md';

public function testCorrectDocumentation(): void
{
$file = beyond_path() . $this->path;
$contents = file_get_contents($file);

$this->assertFileExists($file);
$this->assertStringContainsString('# Event', $contents);
$this->assertStringContainsString('modules/{Module}/Domain/Events', $contents);
$this->assertStringContainsString('beyond:make:event {name} {--force}', $contents);
}
}
21 changes: 21 additions & 0 deletions tests/DocumentationTest/JobTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

namespace Tests\DocumentationTest;

use Tests\TestCase;

class JobTest extends TestCase
{
protected string $path = '/docs/commands/job.md';

public function testCorrectDocumentation(): void
{
$file = beyond_path() . $this->path;
$contents = file_get_contents($file);

$this->assertFileExists($file);
$this->assertStringContainsString('# Job', $contents);
$this->assertStringContainsString('modules/{Module}/App/Jobs', $contents);
$this->assertStringContainsString('beyond:make:job {name} {--sync} {--force}', $contents);
}
}
21 changes: 21 additions & 0 deletions tests/DocumentationTest/ListenerTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

namespace Tests\DocumentationTest;

use Tests\TestCase;

class ListenerTest extends TestCase
{
protected string $path = '/docs/commands/listener.md';

public function testCorrectDocumentation(): void
{
$file = beyond_path() . $this->path;
$contents = file_get_contents($file);

$this->assertFileExists($file);
$this->assertStringContainsString('# Listener', $contents);
$this->assertStringContainsString('modules/{Module}/App/Listeners', $contents);
$this->assertStringContainsString('beyond:make:listener {name} {--force}', $contents);
}
}

0 comments on commit dc5496a

Please sign in to comment.