Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Version 2.0.x support of Laravel Doctrine ORM ^3.1 and Laravel 12
- Support of Laravel 12
- Support of Laravel Doctrine ORM ^3.1
- Migrated to attributes instead of annotations
- PHPUnit setup workbench for laravel imulation
- GitHub actions setup php tests on github
- PHPCS, PHPStan upgrade coding standards
- Updated README.md
  • Loading branch information
R3VoLuT1OneR committed Apr 26, 2025
commit b96a3e8c7724c3be8e7c005928dfd1bb893c4d40
39 changes: 0 additions & 39 deletions .github/workflows/ci.yml

This file was deleted.

20 changes: 20 additions & 0 deletions .github/workflows/coding-standards.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: "Coding Standards"

on:
pull_request:
branches:
- "*.x"
- "main"
push:
branches:
- "*.x"
- "main"

jobs:
coding-standards:
name: "Coding Standards"
uses: "doctrine/.github/.github/workflows/[email protected]"
with:
php-version: '8.2'
composer-options: '--prefer-dist --ignore-platform-req=php'

61 changes: 61 additions & 0 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: "Continuous Integration"

on:
pull_request:
branches:
- "*.x"
- "main"
push:
branches:
- "*.x"
- "main"

jobs:
phpunit:
name: "PHPUnit"
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
php-version:
- "8.2"
- "8.3"
- "8.4"
dependencies:
- "highest"
- "lowest"
optional-dependencies:
- true
- false

steps:
- name: "Checkout"
uses: "actions/checkout@v2"
with:
fetch-depth: 2

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
php-version: "${{ matrix.php-version }}"
coverage: "pcov"
ini-values: "zend.assertions=1"
extensions: "pdo_mysql"

- name: "Install dependencies with Composer"
uses: "ramsey/composer-install@v1"
with:
dependency-versions: "${{ matrix.dependencies }}"
composer-options: "--prefer-dist"

- name: "Show Composer packages"
run: "composer show"

- name: "Run PHPUnit"
run: "vendor/bin/phpunit --coverage-clover=coverage.xml"

- name: "Upload coverage"
uses: "codecov/codecov-action@v5"
with:
token: ${{ secrets.CODECOV_TOKEN }}
36 changes: 36 additions & 0 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: "Static Analysis"

on:
pull_request:
push:

jobs:
static-analysis-phpstan:
name: "Static Analysis with PHPStan"
runs-on: "ubuntu-22.04"

strategy:
matrix:
php-version:
- "8.2"
- "8.3"
- "8.4"

steps:
- name: "Checkout code"
uses: "actions/checkout@v3"

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
php-version: "${{ matrix.php-version }}"
extensions: "pdo_sqlite"

- name: "Install dependencies with Composer"
uses: "ramsey/composer-install@v2"
with:
dependency-versions: "${{ matrix.dependencies }}"

- name: "Run a static analysis with phpstan/phpstan"
run: "vendor/bin/phpstan analyse src --level 1"
15 changes: 14 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
/coverage
/vendor
composer.phar
composer.lock
.DS_Store
.php_cs.cache
.phpcs-cache
.phpunit.cache
.phpunit.result.cache


.idea
.vscode

/tests/Stubs/storage/framework/views/*
!/tests/Stubs/storage/framework/views/.gitkeep
/tests/Stubs/storage/doctrine.generated.php
laravel-doctrine-orm.iml
/workbench/bootstrap/cache/*
!/workbench/bootstrap/cache/.gitkeep
/workbench/storage/logs/*
/workbench/vendor
56 changes: 38 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,44 @@
# Laravel Doctrine ACL
<p align="center">
<img src="https://placehold.co/10x10/337ab7/337ab7.png" width="100%" height="15px">
<img width="450px" src="https://github.com/laravel-doctrine/acl/blob/2.0.x/docs/banner.png"/>
</p>

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

[![GitHub release](https://img.shields.io/github/release/laravel-doctrine/acl.svg?style=flat-square)](https://packagist.org/packages/laravel-doctrine/acl)
[![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)
[![Packagist](https://img.shields.io/packagist/dm/laravel-doctrine/acl.svg?style=flat-square)](https://packagist.org/packages/laravel-doctrine/acl)
[![Packagist](https://img.shields.io/packagist/dt/laravel-doctrine/acl.svg?style=flat-square)](https://packagist.org/packages/laravel-doctrine/acl)
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.

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

* Roles
* Permissions
* Organisations
* Seamless integration with Laravel's Authorization system
Installation
------------

## Versions
Via composer:

Version | Supported Laravel Versions
:---------|:----------
~1.1.0 | 6.x
~1.2.0 | 7.x
~1.3.0 | 8.x
^1.4.0 | 6.x, 7.x, 8.x, 9.x, 10.x
```bash
composer require laravel-doctrine/acl
```

The ServiceProvider and Facades are autodiscovered.

Publish the configuration:

```bash
php artisan vendor:publish --tag="config" --provider="LaravelDoctrine\ACL\AclServiceProvider"
```

Documentation
-------------

Full documentation at https://laravel-doctrine-acl.readthedocs.io/en/latest/index.html
or in the docs directory.

Versions
--------

* Version 2 supports DBAL ^4.0, ORM ^3.0, and PHP 8.2.
* Version 1 supports Laravel 6 - 11, DBAL ^2.0, ORM ^2.0, and PHP ^5.5 - ^8.0.
146 changes: 94 additions & 52 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,55 +1,97 @@
{
"name": "laravel-doctrine/acl",
"type": "library",
"description": "Doctrine ACL for Doctrine 2 and Laravel",
"license": "MIT",
"keywords": [
"doctrine",
"laravel",
"orm",
"data mapper",
"database",
"acl",
"abilities",
"policies",
"permissions",
"roles",
"organisations"
],
"authors": [
{
"name": "Patrick Brouwers",
"email": "[email protected]"
"name": "laravel-doctrine/acl",
"type": "library",
"description": "Doctrine ACL for Doctrine 2 and Laravel",
"license": "MIT",
"keywords": [
"doctrine",
"laravel",
"orm",
"data mapper",
"database",
"acl",
"abilities",
"policies",
"permissions",
"roles",
"organisations"
],
"authors": [
{
"name": "Patrick Brouwers",
"email": "[email protected]"
},
{
"name": "Pavlo Zhytomyrskyi",
"email": "[email protected]"
}
],
"require": {
"php": "^8.2",
"illuminate/auth": "^11.0|^12.0",
"illuminate/config": "^11.0|^12.0",
"illuminate/contracts": "^11.0|^12.0",
"illuminate/support": "^11.0|^12.0",
"laravel-doctrine/orm": "^3.1"
},
"require-dev": {
"mockery/mockery": "^1.3.1",
"phpunit/phpunit": "^11.5",
"laravel/framework": "^11.0|^12.0",
"orchestra/testbench": "^10.2",
"laravel-doctrine/migrations": "^3.4",
"doctrine/coding-standard": "^12.0",
"php-parallel-lint/php-parallel-lint": "^1.4",
"phpstan/phpstan": "^2.1",
"phpstan/phpstan-deprecation-rules": "^2.0"
},
"autoload": {
"psr-4": {
"LaravelDoctrine\\ACL\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests",
"Workbench\\App\\": "workbench/app/",
"Workbench\\Database\\Factories\\": "workbench/database/factories/",
"Workbench\\Database\\Seeders\\": "workbench/database/seeders/"
}
},
"extra": {
"laravel": {
"providers": [
"LaravelDoctrine\\ACL\\AclServiceProvider"
]
}
},
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
}
},
"scripts": {
"test": [
"vendor/bin/parallel-lint src tests",
"vendor/bin/phpcs",
"vendor/bin/phpunit",
"vendor/bin/phpstan analyze src --level 1"
],
"coverage": "XDEBUG_MODE=coverage vendor/bin/phpunit --coverage-html=coverage",
"post-autoload-dump": [
"@clear",
"@prepare"
],
"clear": "@php vendor/bin/testbench package:purge-skeleton --ansi",
"prepare": "@php vendor/bin/testbench package:discover --ansi",
"build": "@php vendor/bin/testbench workbench:build --ansi",
"serve": [
"Composer\\Config::disableProcessTimeout",
"@build",
"@php vendor/bin/testbench serve --ansi"
],
"lint": [
"@php vendor/bin/phpstan analyse --verbose --ansi"
]
}
],
"require": {
"php": "^7.2.5|^8.0",
"illuminate/auth": "^6.0|^7.0|^8.0|^9.0|^10.0",
"illuminate/config": "^6.0|^7.0|^8.0|^9.0|^10.0",
"illuminate/contracts": "^6.0|^7.0|^8.0|^9.0|^10.0",
"illuminate/support": "^6.0|^7.0|^8.0|^9.0|^10.0",
"laravel-doctrine/orm": "^1|^2.0",
"doctrine/annotations": "^1.10|^2.0"
},
"require-dev": {
"mockery/mockery": "^1.3.1",
"phpunit/phpunit": "^8.5"
},
"autoload": {
"psr-4": {
"LaravelDoctrine\\ACL\\": "src/"
}
},
"autoload-dev": {
"classmap": [
"tests"
]
},
"extra": {
"laravel": {
"providers": [
"LaravelDoctrine\\ACL\\AclServiceProvider"
]
}
}
}
Loading
Loading