Skip to content

Commit

Permalink
v73.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
gammamatrix committed Mar 13, 2024
1 parent fc26bf0 commit 0e92bf9
Show file tree
Hide file tree
Showing 41 changed files with 118 additions and 40 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 'Tests: Playground Auth'
name: 'CI'

on:
push:
Expand Down Expand Up @@ -99,7 +99,7 @@ jobs:
env:
XDEBUG_MODE: coverage
with:
version: "10.5"
version: "11.0"
php_version: "8.2"
php_extensions: intl xdebug
coverage_clover: clover.xml
Expand Down
8 changes: 5 additions & 3 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
'class_definition' => [
'multi_line_extends_each_single_line' => true,
'single_item_single_line' => true,
'single_line' => true,
'single_line' => false,
],
'clean_namespace' => true,
'compact_nullable_typehint' => true,
Expand All @@ -59,6 +59,7 @@
'encoding' => true,
'full_opening_tag' => true,
'fully_qualified_strict_types' => true,
'declare_strict_types' => true,
'function_declaration' => true,
'general_phpdoc_tag_rename' => true,
'heredoc_to_nowdoc' => true,
Expand Down Expand Up @@ -215,12 +216,13 @@
->in([
__DIR__.'/config',
__DIR__.'/database',
__DIR__ . '/lang',
__DIR__.'/lang',
__DIR__.'/src',
__DIR__.'/tests/Feature',
__DIR__ . '/tests/Unit',
__DIR__.'/tests/Unit',
])
->name('*.php')
->name('*.phps')
->notName('*.blade.php')
->ignoreDotFiles(true)
->ignoreVCS(true)
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
[![Test Coverage](https://raw.githubusercontent.com/gammamatrix/playground-auth/testing/develop/coverage.svg)](tests)
[![PHPStan Level 9](https://img.shields.io/badge/PHPStan-level%209-brightgreen)](.github/workflows/ci.yml#L120)

The Playground authentication and authorization package for [Laravel](https://laravel.com/docs/10.x) applications.
The Playground authentication and authorization package for [Laravel](https://laravel.com/docs/11.x) applications.

More information is available [on the Playground Auth wiki.](https://github.com/gammamatrix/playground-auth/wiki)
Read more on using Playground Auth [at the Read the Docs for Playground.](https://gammamatrix-playground.readthedocs.io/)

## Installation

Expand Down Expand Up @@ -43,7 +43,7 @@ The default configuration utitlizes:

Depending on your needs, there are multiple middleware, authentication and authorization options available.

Abilities may be used with wildcards at multiple levels. Optionally, these abilities may be used with [Sanctum](https://laravel.com/docs/10.x/sanctum) for API Tokens.
Abilities may be used with wildcards at multiple levels. Optionally, these abilities may be used with [Sanctum](https://laravel.com/docs/11.x/sanctum) for API Tokens.

Here is an example of the configurable abilities:
```php
Expand Down
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gammamatrix/playground-auth",
"description": "Playground: Provide authentication for Laravel applications using Blade for the UI. Allows using Sanctum.",
"description": "The Playground authentication and authorization package for Laravel applications.",
"keywords": [
"auth",
"authentication",
Expand All @@ -11,7 +11,7 @@
"playground-auth",
"sanctum"
],
"homepage": "https://github.com/gammamatrix/playground-auth/wiki",
"homepage": "https://gammamatrix-playground.readthedocs.io/",
"license": "MIT",
"authors": [
{
Expand All @@ -21,11 +21,11 @@
}
],
"require": {
"php": "^8.1",
"gammamatrix/playground": "dev-develop|dev-master|dev-feature/*|^73.0"
"php": "^8.2",
"gammamatrix/playground": "dev-develop|dev-master|dev-feature/*|^73.0@dev|^73.0"
},
"require-dev": {
"gammamatrix/playground-test": "dev-develop|dev-master|dev-feature/*|^73.0"
"gammamatrix/playground-test": "dev-develop|dev-master|dev-feature/*|^73.0@dev|^73.0"
},
"minimum-stability": "dev",
"prefer-stable": true,
Expand Down
2 changes: 2 additions & 0 deletions config/playground-auth.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

return [

/*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Query\Expression;
use Illuminate\Database\Schema\Blueprint;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
Expand Down
2 changes: 2 additions & 0 deletions lang/en/auth.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

return [

/*
Expand Down
12 changes: 7 additions & 5 deletions phpunit.xml.dev
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.1/phpunit.xsd"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
bootstrap="vendor/autoload.php"
colors="true"
stopOnSkipped="false"
Expand Down Expand Up @@ -61,16 +61,18 @@
<env name="APP_DEBUG" value="false"/>
<env name="APP_ENV" value="testing"/>
<env name="APP_KEY" value="base64:lNTGdmOOxP5uNUVuCj9FB//Ssn8JmRXBdtPEE4/QReE="/>
<env name="APP_MAINTENANCE_DRIVER" value="file"/>
<env name="BCRYPT_ROUNDS" value="4"/>
<env name="CACHE_DRIVER" value="array"/>
<env name="LOG_CHANNEL" value="stderr"/>
<env name="CACHE_STORE" value="array"/>
<env name="DB_CONNECTION" value="sqlite"/>
<env name="DB_DATABASE" value=":memory:"/>
<env name="TEST_DB_MIGRATIONS" value="true"/>
<env name="LOG_CHANNEL" value="stderr"/>
<env name="MAIL_MAILER" value="log"/>
<env name="PULSE_ENABLED" value="false"/>
<env name="QUEUE_CONNECTION" value="sync"/>
<env name="SESSION_DRIVER" value="array"/>
<env name="TELESCOPE_ENABLED" value="false"/>
<ini name="memory_limit" value="512M" />
<env name="TEST_DB_MIGRATIONS" value="true"/>
<ini name="memory_limit" value="128M" />
</php>
</phpunit>
11 changes: 7 additions & 4 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.1/phpunit.xsd"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
bootstrap="vendor/autoload.php"
colors="true"
stopOnSkipped="false"
Expand Down Expand Up @@ -61,15 +61,18 @@
<env name="APP_DEBUG" value="false"/>
<env name="APP_ENV" value="testing"/>
<env name="APP_KEY" value="base64:lNTGdmOOxP5uNUVuCj9FB//Ssn8JmRXBdtPEE4/QReE="/>
<env name="APP_MAINTENANCE_DRIVER" value="file"/>
<env name="BCRYPT_ROUNDS" value="4"/>
<env name="CACHE_DRIVER" value="array"/>
<env name="CACHE_STORE" value="array"/>
<env name="DB_CONNECTION" value="sqlite"/>
<env name="DB_DATABASE" value=":memory:"/>
<env name="TEST_DB_MIGRATIONS" value="true"/>
<!-- <env name="LOG_CHANNEL" value="stderr"/> -->
<env name="MAIL_MAILER" value="log"/>
<env name="PULSE_ENABLED" value="false"/>
<env name="QUEUE_CONNECTION" value="sync"/>
<env name="SESSION_DRIVER" value="array"/>
<env name="TELESCOPE_ENABLED" value="false"/>
<ini name="memory_limit" value="512M" />
<env name="TEST_DB_MIGRATIONS" value="true"/>
<ini name="memory_limit" value="128M" />
</php>
</phpunit>
2 changes: 2 additions & 0 deletions src/Can.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php

declare(strict_types=1);
/**
* Playground
*/
Expand Down
2 changes: 2 additions & 0 deletions src/Console/Commands/HashPassword.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php

declare(strict_types=1);
/**
* Playground
*/
Expand Down
2 changes: 2 additions & 0 deletions src/Facades/Can.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php

declare(strict_types=1);
/**
* Playground
*/
Expand Down
2 changes: 2 additions & 0 deletions src/Issuer.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php

declare(strict_types=1);
/**
* Playground
*/
Expand Down
2 changes: 2 additions & 0 deletions src/Permission.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php

declare(strict_types=1);
/**
* Playground
*/
Expand Down
2 changes: 2 additions & 0 deletions src/Policies/Contracts/Role.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php

declare(strict_types=1);
/**
* Playground
*/
Expand Down
6 changes: 4 additions & 2 deletions src/Policies/ModelPolicy.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php

declare(strict_types=1);
/**
* Playground
*/
Expand Down Expand Up @@ -37,7 +39,7 @@ public function delete(
// return Response::denyWithStatus(423);
return Response::denyWithStatus(423, __('playground-auth::auth.model.locked', [
'model' => Str::of(class_basename($model))
->snake()->replace('_', ' ')->title()->lower(),
->snake()->replace('_', ' ')->title()->lower()->toString(),
]));
}

Expand Down Expand Up @@ -112,7 +114,7 @@ public function update(Authenticatable $user, Model $model): bool|Response
if ($model->getAttribute('locked')) {
// return Response::denyWithStatus(423);
return Response::denyWithStatus(423, __('playground-auth::auth.model.locked', [
'model' => Str::of(class_basename($model))->snake()->replace('_', ' ')->title()->lower(),
'model' => Str::of(class_basename($model))->snake()->replace('_', ' ')->title()->lower()->toString(),
]));
}

Expand Down
2 changes: 2 additions & 0 deletions src/Policies/Policy.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php

declare(strict_types=1);
/**
* Playground
*/
Expand Down
2 changes: 2 additions & 0 deletions src/Policies/PolicyTrait.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php

declare(strict_types=1);
/**
* Playground
*/
Expand Down
2 changes: 2 additions & 0 deletions src/Policies/PrivilegeTrait.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php

declare(strict_types=1);
/**
* Playground
*/
Expand Down
2 changes: 2 additions & 0 deletions src/Policies/RoleTrait.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php

declare(strict_types=1);
/**
* Playground
*/
Expand Down
2 changes: 2 additions & 0 deletions src/ServiceProvider.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php

declare(strict_types=1);
/**
* Playground
*/
Expand Down
2 changes: 2 additions & 0 deletions tests/Feature/TestCase.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php

declare(strict_types=1);
/**
* Playground
*/
Expand Down
2 changes: 2 additions & 0 deletions tests/Unit/Console/Commands/HashPassword/CommandTest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php

declare(strict_types=1);
/**
* Playground
*/
Expand Down
2 changes: 2 additions & 0 deletions tests/Unit/Policies/ModelPolicy/AbstractRoleTest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php

declare(strict_types=1);
/**
* Playground
*/
Expand Down
2 changes: 2 additions & 0 deletions tests/Unit/Policies/ModelPolicy/TestPolicy.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php

declare(strict_types=1);
/**
* Playground
*/
Expand Down
2 changes: 2 additions & 0 deletions tests/Unit/Policies/Policy/AbstractTest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php

declare(strict_types=1);
/**
* Playground
*/
Expand Down
2 changes: 2 additions & 0 deletions tests/Unit/Policies/Policy/TestPolicy.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php

declare(strict_types=1);
/**
* Playground
*/
Expand Down
2 changes: 2 additions & 0 deletions tests/Unit/Policies/PolicyTrait/Policy.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php

declare(strict_types=1);
/**
* Playground
*/
Expand Down
Loading

0 comments on commit 0e92bf9

Please sign in to comment.