Skip to content

Commit f98d76e

Browse files
authored
Merge pull request #5 from Lomkit/feature/reworked-package
Feature/reworked package
2 parents 6b5a45b + 89504ed commit f98d76e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+986
-1201
lines changed

.github/ISSUE_TEMPLATE/Bug_report.yml

Lines changed: 0 additions & 43 deletions
This file was deleted.

.github/ISSUE_TEMPLATE/Question_or_enhancement_proposal.yml

Lines changed: 0 additions & 9 deletions
This file was deleted.

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 0 additions & 5 deletions
This file was deleted.

.github/workflows/tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ jobs:
1414
strategy:
1515
fail-fast: false
1616
matrix:
17-
php-version: [ '8.1', '8.2', '8.3' ]
18-
laravel-version: [ '^10.0' ]
17+
php-version: [ '8.2', '8.3', '8.4' ]
18+
laravel-version: [ '^11.0', '^12.0' ]
1919
database: [ 'sqlite', 'mysql', 'pgsql' ]
2020

2121
name: Tests on PHP ${{ matrix.php-version }} with Laravel ${{ matrix.laravel-version }} and ${{ matrix.database }}

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@
1010
}
1111
],
1212
"require": {
13-
"php": "^8.1",
13+
"php": "^8.2",
1414
"ext-json": "*",
15-
"laravel/framework": "^10.0"
15+
"laravel/framework": "^11.0|^12.0"
1616
},
1717
"require-dev": {
1818
"guzzlehttp/guzzle": "^6.0|^7.0",
19-
"orchestra/testbench": "^8.5",
20-
"phpunit/phpunit": "^8.0|^9.0|^10.0"
19+
"orchestra/testbench": "^9|^10",
20+
"phpunit/phpunit": "^11.0"
2121
},
2222
"autoload": {
2323
"psr-4": {

config/access-control.php

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,14 @@
11
<?php
22

33
return [
4-
5-
/*
6-
|--------------------------------------------------------------------------
7-
| Access Control Perimeters
8-
|--------------------------------------------------------------------------
9-
|
10-
|
11-
*/
12-
13-
'perimeters' => [
14-
'path' => app_path('Access/Perimeters'),
15-
],
16-
174
/*
185
|--------------------------------------------------------------------------
196
| Access Control Queries
207
|--------------------------------------------------------------------------
218
|
22-
|
239
*/
2410
'queries' => [
25-
'enabled_by_default' => true,
11+
'enabled_by_default' => false,
12+
'isolated' => true, // Isolate the control's logic by applying a parent where on the query
2613
],
2714
];

src/AccessServiceProvider.php

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,11 @@
33
namespace Lomkit\Access;
44

55
use Illuminate\Support\ServiceProvider;
6-
use Lomkit\Access\Perimeters\Perimeters;
76

87
class AccessServiceProvider extends ServiceProvider
98
{
10-
// @TODO: add the ability to remove control scope on certain conditions
11-
129
/**
13-
* Register the service provider.
10+
* Registers the service provider.
1411
*
1512
* @return void
1613
*/
@@ -20,8 +17,6 @@ public function register()
2017
__DIR__.'/../config/access-control.php',
2118
'access-control'
2219
);
23-
24-
$this->registerServices();
2520
}
2621

2722
/**
@@ -32,31 +27,6 @@ public function register()
3227
public function boot()
3328
{
3429
$this->registerPublishing();
35-
36-
$this->registerPerimeters();
37-
}
38-
39-
/**
40-
* Register Access's perimeters.
41-
*
42-
* @return void
43-
*/
44-
protected function registerPerimeters()
45-
{
46-
$this->app->make(Perimeters::class)
47-
->perimetersIn(
48-
config('access-control.perimeters.path', app_path('Access/Perimeters'))
49-
);
50-
}
51-
52-
/**
53-
* Register Access's services in the container.
54-
*
55-
* @return void
56-
*/
57-
protected function registerServices()
58-
{
59-
$this->app->singleton(Perimeters::class);
6030
}
6131

6232
/**

src/ControlScope.php

Lines changed: 0 additions & 73 deletions
This file was deleted.

src/Controls/Concerns/HasPolicy.php

Lines changed: 0 additions & 32 deletions
This file was deleted.

src/Controls/Concerns/HasQuery.php

Lines changed: 0 additions & 47 deletions
This file was deleted.

0 commit comments

Comments
 (0)