Skip to content

Commit

Permalink
v73.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
gammamatrix committed Jul 8, 2024
1 parent c833de1 commit c7c2141
Show file tree
Hide file tree
Showing 18 changed files with 214 additions and 255 deletions.
55 changes: 55 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,66 @@ Playground provides information in the `artisan about` command.
<img src="resources/docs/artisan-about-playground.png" alt="screenshot of artisan about command with Playground.">


### Environment Variables

| env() | config() |
|-------------------------------------|-------------------------------------|
| `PLAYGROUND_LOAD_MIGRATIONS` | `playground.load.migrations` |
- The loading option for migrations does not take effect if the migrations have been exported to your app. The control for loading is handled in the package [ServiceProvider.](src/ServiceProvider.php)


## Migrations

The migrations provided in this package are used for [PHPunit 11](https://docs.phpunit.de/en/11.0/) feature testing with [Orchestra Testbench](https://packages.tools/testbench.html).
- They will not be exported in software builds.

## Cloc

```sh
composer cloc
```

```
➜ playground git:(develop) ✗ composer cloc
> cloc --exclude-dir=output,vendor .
98 text files.
62 unique files.
38 files ignored.
github.com/AlDanial/cloc v 1.98 T=0.11 s (582.6 files/s, 57515.8 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
PHP 52 921 856 3591
YAML 1 5 0 275
XML 3 0 9 222
JSON 2 0 0 103
Markdown 3 42 0 82
INI 1 3 0 12
-------------------------------------------------------------------------------
SUM: 62 971 865 4285
-------------------------------------------------------------------------------
```

## PHPStan

Tests at level 9 on:
- `config/`
- `database/`
- `src/`
- `tests/Feature/`
- `tests/Unit/`

```sh
composer analyse
```

## Coding Standards

```sh
composer format
```

## Testing

```sh
Expand Down
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,9 @@
}
},
"scripts": {
"test": "vendor/bin/testbench package:test",
"analyse": "vendor/bin/phpstan analyse --verbose --debug --level max",
"cloc": "cloc --exclude-dir=output,vendor .",
"format": "vendor/bin/php-cs-fixer fix",
"analyse": "vendor/bin/phpstan analyse --verbose --debug --level max"
"test": "vendor/bin/phpunit"
}
}
13 changes: 13 additions & 0 deletions config/playground.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,19 @@

'about' => (bool) env('PLAYGROUND_ABOUT', true),

/*
|--------------------------------------------------------------------------
| Loading
|--------------------------------------------------------------------------
|
| By default, migrations are disabled.
|
*/

'load' => [
'migrations' => (bool) env('PLAYGROUND_LOAD_MIGRATIONS', false),
],

/*
|--------------------------------------------------------------------------
| Packages
Expand Down
60 changes: 60 additions & 0 deletions database/factories/UserFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,64 @@ public function unverified(): static
'email_verified_at' => null,
]);
}

/**
* Indicate that the user has the admin role.
*
* @return Factory<User>
*/
public function admin(): Factory
{
return $this->state(fn (array $attributes) => [
'role' => 'admin',
]);
}

/**
* Indicate that the user has the guest role.
*
* @return Factory<User>
*/
public function guest(): Factory
{
return $this->state(fn (array $attributes) => [
'role' => 'guest',
]);
}

/**
* Indicate that the user has the manager role.
*
* @return Factory<User>
*/
public function manager(): Factory
{
return $this->state(fn (array $attributes) => [
'role' => 'manager',
]);
}

/**
* Indicate that the user has the root role.
*
* @return Factory<User>
*/
public function root(): Factory
{
return $this->state(fn (array $attributes) => [
'role' => 'root',
]);
}

/**
* Indicate that the user has the wheel role.
*
* @return Factory<User>
*/
public function wheel(): Factory
{
return $this->state(fn (array $attributes) => [
'role' => 'wheel',
]);
}
}

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit c7c2141

Please sign in to comment.