Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/reworked package #5

Merged
merged 13 commits into from
Apr 7, 2025
43 changes: 0 additions & 43 deletions .github/ISSUE_TEMPLATE/Bug_report.yml

This file was deleted.

9 changes: 0 additions & 9 deletions .github/ISSUE_TEMPLATE/Question_or_enhancement_proposal.yml

This file was deleted.

5 changes: 0 additions & 5 deletions .github/ISSUE_TEMPLATE/config.yml

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ jobs:
strategy:
fail-fast: false
matrix:
php-version: [ '8.1', '8.2', '8.3' ]
laravel-version: [ '^10.0' ]
php-version: [ '8.2', '8.3', '8.4' ]
laravel-version: [ '^11.0', '^12.0' ]
database: [ 'sqlite', 'mysql', 'pgsql' ]

name: Tests on PHP ${{ matrix.php-version }} with Laravel ${{ matrix.laravel-version }} and ${{ matrix.database }}
Expand Down
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
}
],
"require": {
"php": "^8.1",
"php": "^8.2",
"ext-json": "*",
"laravel/framework": "^10.0"
"laravel/framework": "^11.0|^12.0"
},
"require-dev": {
"guzzlehttp/guzzle": "^6.0|^7.0",
"orchestra/testbench": "^8.5",
"phpunit/phpunit": "^8.0|^9.0|^10.0"
"orchestra/testbench": "^9|^10",
"phpunit/phpunit": "^11.0"
},
"autoload": {
"psr-4": {
Expand Down
17 changes: 2 additions & 15 deletions config/access-control.php
Original file line number Diff line number Diff line change
@@ -1,27 +1,14 @@
<?php

return [

/*
|--------------------------------------------------------------------------
| Access Control Perimeters
|--------------------------------------------------------------------------
|
|
*/

'perimeters' => [
'path' => app_path('Access/Perimeters'),
],

/*
|--------------------------------------------------------------------------
| Access Control Queries
|--------------------------------------------------------------------------
|
|
*/
'queries' => [
'enabled_by_default' => true,
'enabled_by_default' => false,
'isolated' => true, // Isolate the control's logic by applying a parent where on the query
],
];
32 changes: 1 addition & 31 deletions src/AccessServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,11 @@
namespace Lomkit\Access;

use Illuminate\Support\ServiceProvider;
use Lomkit\Access\Perimeters\Perimeters;

class AccessServiceProvider extends ServiceProvider
{
// @TODO: add the ability to remove control scope on certain conditions

/**
* Register the service provider.
* Registers the service provider.
*
* @return void
*/
Expand All @@ -20,8 +17,6 @@ public function register()
__DIR__.'/../config/access-control.php',
'access-control'
);

$this->registerServices();
}

/**
Expand All @@ -32,31 +27,6 @@ public function register()
public function boot()
{
$this->registerPublishing();

$this->registerPerimeters();
}

/**
* Register Access's perimeters.
*
* @return void
*/
protected function registerPerimeters()
{
$this->app->make(Perimeters::class)
->perimetersIn(
config('access-control.perimeters.path', app_path('Access/Perimeters'))
);
}

/**
* Register Access's services in the container.
*
* @return void
*/
protected function registerServices()
{
$this->app->singleton(Perimeters::class);
}

/**
Expand Down
73 changes: 0 additions & 73 deletions src/ControlScope.php

This file was deleted.

32 changes: 0 additions & 32 deletions src/Controls/Concerns/HasPolicy.php

This file was deleted.

47 changes: 0 additions & 47 deletions src/Controls/Concerns/HasQuery.php

This file was deleted.

Loading