Skip to content

Commit bbf7cb9

Browse files
authored
Merge pull request #73 from ScholarshipOwl/2.0.x
Version 2.0.x support of Laravel Doctrine ORM ^3.1 and Laravel 12
2 parents 8eafde6 + adb2027 commit bbf7cb9

File tree

117 files changed

+3660
-1921
lines changed

Some content is hidden

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

117 files changed

+3660
-1921
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 39 deletions
This file was deleted.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: "Coding Standards"
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- "*.x"
7+
- "main"
8+
push:
9+
branches:
10+
- "*.x"
11+
- "main"
12+
13+
jobs:
14+
coding-standards:
15+
name: "Coding Standards"
16+
uses: "doctrine/.github/.github/workflows/[email protected]"
17+
with:
18+
php-version: '8.2'
19+
composer-options: '--prefer-dist --ignore-platform-req=php'
20+
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: "Continuous Integration"
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- "*.x"
7+
- "main"
8+
push:
9+
branches:
10+
- "*.x"
11+
- "main"
12+
13+
jobs:
14+
phpunit:
15+
name: "PHPUnit"
16+
runs-on: ubuntu-latest
17+
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
php-version:
22+
- "8.2"
23+
- "8.3"
24+
- "8.4"
25+
dependencies:
26+
- "highest"
27+
- "lowest"
28+
optional-dependencies:
29+
- true
30+
- false
31+
32+
steps:
33+
- name: "Checkout"
34+
uses: "actions/checkout@v2"
35+
with:
36+
fetch-depth: 2
37+
38+
- name: "Install PHP"
39+
uses: "shivammathur/setup-php@v2"
40+
with:
41+
php-version: "${{ matrix.php-version }}"
42+
coverage: "pcov"
43+
ini-values: "zend.assertions=1"
44+
extensions: "pdo_mysql"
45+
46+
- name: "Install dependencies with Composer"
47+
uses: "ramsey/composer-install@v1"
48+
with:
49+
dependency-versions: "${{ matrix.dependencies }}"
50+
composer-options: "--prefer-dist"
51+
52+
- name: "Show Composer packages"
53+
run: "composer show"
54+
55+
- name: "Run PHPUnit"
56+
run: "vendor/bin/phpunit --coverage-clover=coverage.xml"
57+
58+
- name: "Upload coverage"
59+
uses: "codecov/codecov-action@v5"
60+
with:
61+
token: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/static-analysis.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: "Static Analysis"
2+
3+
on:
4+
pull_request:
5+
push:
6+
7+
jobs:
8+
static-analysis-phpstan:
9+
name: "Static Analysis with PHPStan"
10+
runs-on: "ubuntu-22.04"
11+
12+
strategy:
13+
matrix:
14+
php-version:
15+
- "8.2"
16+
- "8.3"
17+
- "8.4"
18+
19+
steps:
20+
- name: "Checkout code"
21+
uses: "actions/checkout@v3"
22+
23+
- name: "Install PHP"
24+
uses: "shivammathur/setup-php@v2"
25+
with:
26+
coverage: "none"
27+
php-version: "${{ matrix.php-version }}"
28+
extensions: "pdo_sqlite"
29+
30+
- name: "Install dependencies with Composer"
31+
uses: "ramsey/composer-install@v2"
32+
with:
33+
dependency-versions: "${{ matrix.dependencies }}"
34+
35+
- name: "Run a static analysis with phpstan/phpstan"
36+
run: "vendor/bin/phpstan analyse src --level 1"

.gitignore

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,21 @@
1+
/coverage
12
/vendor
23
composer.phar
34
composer.lock
45
.DS_Store
5-
.php_cs.cache
6+
.phpcs-cache
7+
.phpunit.cache
8+
.phpunit.result.cache
9+
610

711
.idea
12+
.vscode
13+
14+
/tests/Stubs/storage/framework/views/*
15+
!/tests/Stubs/storage/framework/views/.gitkeep
16+
/tests/Stubs/storage/doctrine.generated.php
817
laravel-doctrine-orm.iml
18+
/workbench/bootstrap/cache/*
19+
!/workbench/bootstrap/cache/.gitkeep
20+
/workbench/storage/logs/*
21+
/workbench/vendor

README.md

Lines changed: 38 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,44 @@
1-
# Laravel Doctrine ACL
1+
<p align="center">
2+
<img src="https://placehold.co/10x10/337ab7/337ab7.png" width="100%" height="15px">
3+
<img width="450px" src="https://github.com/laravel-doctrine/acl/blob/2.0.x/docs/banner.png"/>
4+
</p>
25

3-
<img src="https://cloud.githubusercontent.com/assets/7728097/12727113/9e4fbc48-c91b-11e5-9987-e263eee9db12.jpg"/>
6+
Laravel Doctrine ACL
7+
====================
48

5-
[![GitHub release](https://img.shields.io/github/release/laravel-doctrine/acl.svg?style=flat-square)](https://packagist.org/packages/laravel-doctrine/acl)
6-
[![Github actions](https://github.com/laravel-doctrine/acl/workflows/CI/badge.svg?branch=1.x)](https://github.com/laravel-doctrine/acl/actions?query=workflow%3ACI+branch%3A1.x)
7-
[![Packagist](https://img.shields.io/packagist/dm/laravel-doctrine/acl.svg?style=flat-square)](https://packagist.org/packages/laravel-doctrine/acl)
8-
[![Packagist](https://img.shields.io/packagist/dt/laravel-doctrine/acl.svg?style=flat-square)](https://packagist.org/packages/laravel-doctrine/acl)
9+
Laravel Doctrine ACL is a package that provides RBAC (Role-Based Access Control) functionality for Laravel applications using Doctrine. It allows you to manage roles, permissions, and organisations, and seamlessly integrates with Laravel's Authorization system.
910

10-
*ACL functionality for Laravel powered by Doctrine*
11+
[![Build Status](https://github.com/laravel-doctrine/acl/actions/workflows/continuous-integration.yml/badge.svg)](https://github.com/laravel-doctrine/acl/actions)
12+
[![Code Coverage](https://codecov.io/gh/laravel-doctrine/acl/graph/badge.svg?token=3CpQzDXOWX)](https://codecov.io/gh/laravel-doctrine/acl)
13+
[![PHPStan](https://img.shields.io/badge/PHPStan-level%201-brightgreen.svg)](https://img.shields.io/badge/PHPStan-level%201-brightgreen.svg)
14+
[![Documentation](https://readthedocs.org/projects/laravel-doctrine-acl-official/badge/?version=latest)](https://laravel-doctrine-acl-official.readthedocs.io/en/latest/)
15+
[![Packagist Downloads](https://img.shields.io/packagist/dd/laravel-doctrine/acl)](https://packagist.org/packages/laravel-doctrine/acl)
1116

12-
* Roles
13-
* Permissions
14-
* Organisations
15-
* Seamless integration with Laravel's Authorization system
17+
Installation
18+
------------
1619

17-
## Versions
20+
Via composer:
1821

19-
Version | Supported Laravel Versions
20-
:---------|:----------
21-
~1.1.0 | 6.x
22-
~1.2.0 | 7.x
23-
~1.3.0 | 8.x
24-
^1.4.0 | 6.x, 7.x, 8.x, 9.x, 10.x
22+
```bash
23+
composer require laravel-doctrine/acl
24+
```
25+
26+
The ServiceProvider and Facades are autodiscovered.
27+
28+
Publish the configuration:
29+
30+
```bash
31+
php artisan vendor:publish --tag="config" --provider="LaravelDoctrine\ACL\AclServiceProvider"
32+
```
33+
34+
Documentation
35+
-------------
36+
37+
Full documentation at https://laravel-doctrine-acl.readthedocs.io/en/latest/index.html
38+
or in the docs directory.
39+
40+
Versions
41+
--------
42+
43+
* Version 2 supports Laravel 11-12, ORM ^3.0, DBAL ^4.0, and PHP 8.2.
44+
* Version 1 supports Laravel 6 - 11, DBAL ^2.0, ORM ^2.0, and PHP ^5.5 - ^8.0.

composer.json

Lines changed: 94 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,97 @@
11
{
2-
"name": "laravel-doctrine/acl",
3-
"type": "library",
4-
"description": "Doctrine ACL for Doctrine 2 and Laravel",
5-
"license": "MIT",
6-
"keywords": [
7-
"doctrine",
8-
"laravel",
9-
"orm",
10-
"data mapper",
11-
"database",
12-
"acl",
13-
"abilities",
14-
"policies",
15-
"permissions",
16-
"roles",
17-
"organisations"
18-
],
19-
"authors": [
20-
{
21-
"name": "Patrick Brouwers",
22-
"email": "[email protected]"
2+
"name": "laravel-doctrine/acl",
3+
"type": "library",
4+
"description": "ACL for Laravel and Doctrine",
5+
"license": "MIT",
6+
"keywords": [
7+
"doctrine",
8+
"laravel",
9+
"orm",
10+
"data mapper",
11+
"database",
12+
"acl",
13+
"abilities",
14+
"policies",
15+
"permissions",
16+
"roles",
17+
"organisations"
18+
],
19+
"authors": [
20+
{
21+
"name": "Patrick Brouwers",
22+
"email": "[email protected]"
23+
},
24+
{
25+
"name": "Pavlo Zhytomyrskyi",
26+
"email": "[email protected]"
27+
}
28+
],
29+
"require": {
30+
"php": "^8.2",
31+
"illuminate/auth": "^11.0|^12.0",
32+
"illuminate/config": "^11.0|^12.0",
33+
"illuminate/contracts": "^11.0|^12.0",
34+
"illuminate/support": "^11.0|^12.0",
35+
"laravel-doctrine/orm": "^3.1"
36+
},
37+
"require-dev": {
38+
"mockery/mockery": "^1.3.1",
39+
"phpunit/phpunit": "^11.5",
40+
"laravel/framework": "^11.0|^12.0",
41+
"orchestra/testbench": "^10.2",
42+
"laravel-doctrine/migrations": "^3.4",
43+
"doctrine/coding-standard": "^12.0",
44+
"php-parallel-lint/php-parallel-lint": "^1.4",
45+
"phpstan/phpstan": "^2.1",
46+
"phpstan/phpstan-deprecation-rules": "^2.0"
47+
},
48+
"autoload": {
49+
"psr-4": {
50+
"LaravelDoctrine\\ACL\\": "src/"
51+
}
52+
},
53+
"autoload-dev": {
54+
"psr-4": {
55+
"Tests\\": "tests",
56+
"Workbench\\App\\": "workbench/app/",
57+
"Workbench\\Database\\Factories\\": "workbench/database/factories/",
58+
"Workbench\\Database\\Seeders\\": "workbench/database/seeders/"
59+
}
60+
},
61+
"extra": {
62+
"laravel": {
63+
"providers": [
64+
"LaravelDoctrine\\ACL\\AclServiceProvider"
65+
]
66+
}
67+
},
68+
"config": {
69+
"allow-plugins": {
70+
"dealerdirect/phpcodesniffer-composer-installer": true
71+
}
72+
},
73+
"scripts": {
74+
"test": [
75+
"vendor/bin/parallel-lint src tests",
76+
"vendor/bin/phpcs",
77+
"vendor/bin/phpunit",
78+
"vendor/bin/phpstan analyze src --level 1"
79+
],
80+
"coverage": "XDEBUG_MODE=coverage vendor/bin/phpunit --coverage-html=coverage",
81+
"post-autoload-dump": [
82+
"@clear",
83+
"@prepare"
84+
],
85+
"clear": "@php vendor/bin/testbench package:purge-skeleton --ansi",
86+
"prepare": "@php vendor/bin/testbench package:discover --ansi",
87+
"build": "@php vendor/bin/testbench workbench:build --ansi",
88+
"serve": [
89+
"Composer\\Config::disableProcessTimeout",
90+
"@build",
91+
"@php vendor/bin/testbench serve --ansi"
92+
],
93+
"lint": [
94+
"@php vendor/bin/phpstan analyse --verbose --ansi"
95+
]
2396
}
24-
],
25-
"require": {
26-
"php": "^7.2.5|^8.0",
27-
"illuminate/auth": "^6.0|^7.0|^8.0|^9.0|^10.0",
28-
"illuminate/config": "^6.0|^7.0|^8.0|^9.0|^10.0",
29-
"illuminate/contracts": "^6.0|^7.0|^8.0|^9.0|^10.0",
30-
"illuminate/support": "^6.0|^7.0|^8.0|^9.0|^10.0",
31-
"laravel-doctrine/orm": "^1|^2.0",
32-
"doctrine/annotations": "^1.10|^2.0"
33-
},
34-
"require-dev": {
35-
"mockery/mockery": "^1.3.1",
36-
"phpunit/phpunit": "^8.5"
37-
},
38-
"autoload": {
39-
"psr-4": {
40-
"LaravelDoctrine\\ACL\\": "src/"
41-
}
42-
},
43-
"autoload-dev": {
44-
"classmap": [
45-
"tests"
46-
]
47-
},
48-
"extra": {
49-
"laravel": {
50-
"providers": [
51-
"LaravelDoctrine\\ACL\\AclServiceProvider"
52-
]
53-
}
54-
}
5597
}

0 commit comments

Comments
 (0)