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

feat: Laravel 11 #50

Merged
merged 9 commits into from
Mar 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
6 changes: 3 additions & 3 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
fail-fast: true
matrix:
php: [8.0, 8.1]
php: [8.2, 8.3]
stability: [prefer-stable]

name: PHP ${{ matrix.php }} - ${{ matrix.stability }}
Expand All @@ -39,7 +39,7 @@ jobs:
with:
timeout_minutes: 5
max_attempts: 5
command: composer update --${{ matrix.stability }} --prefer-dist --no-interaction --no-progress
command: COMPOSER_ROOT_VERSION=dev-master composer update --${{ matrix.stability }} --prefer-dist --no-interaction --no-progress

- name: Execute tests
run: vendor/bin/phpunit --verbose
run: vendor/bin/phpunit
2 changes: 1 addition & 1 deletion .github/workflows/lock-closed-issues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ jobs:
#issue-comment: |
# This issue has been locked since it has been closed for more than 14 days.
issue-lock-reason: ""
process-only: "issues"
process-only: "issues"
20 changes: 20 additions & 0 deletions .github/workflows/pint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: PHP Linting
on:
pull_request:
push:
branches:
- master
jobs:
phplint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: "laravel-pint"
uses: aglipanci/laravel-pint-action@2.0.0
with:
preset: laravel
verboseMode: true
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "fix: pint"

5 changes: 3 additions & 2 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Close inactive issues
on:
schedule:
- cron: "30 1 * * *"
- cron: "0 0 * * *"

jobs:
close-issues:
Expand All @@ -12,10 +12,11 @@ jobs:
steps:
- uses: actions/stale@v5
with:
exempt-issue-labels: "bug,security,enhancement,pinned"
days-before-issue-stale: 30
days-before-issue-close: 7
stale-issue-label: "stale"
stale-issue-message: "This issue is stale because it has been open for 30 days with no activity."
stale-issue-message: "This issue is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 7 days."
close-issue-message: "This issue was closed because it has been inactive for 7 days since being marked as stale."
days-before-pr-stale: -1
days-before-pr-close: -1
Expand Down
30 changes: 18 additions & 12 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,27 +22,33 @@ on:

jobs:
static-analysis-phpstan:

name: "Static Analysis with PHPStan"
runs-on: ubuntu-latest

strategy:
fail-fast: true
matrix:
php-version:
- "8.1"
php: [8.2, 8.3]
stability: [prefer-stable]

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

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
coverage: "none"
php-version: "${{ matrix.php-version }}"
tools: "cs2pr"
php-version: ${{ matrix.php }}
tools: composer:v2
coverage: none

- name: "Install dependencies with Composer"
uses: "ramsey/composer-install@v1"
- name: Install dependencies
uses: nick-invision/retry@v1
with:
timeout_minutes: 5
max_attempts: 5
command: COMPOSER_ROOT_VERSION=dev-master composer update --${{ matrix.stability }} --prefer-dist --no-interaction --no-progress

- name: "Run a static analysis with phpstan/phpstan"
run: "vendor/bin/phpstan --error-format=checkstyle | cs2pr"
run: "vendor/bin/phpstan --error-format=table"
7 changes: 4 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
build
build/
composer.lock
docs
vendor
docs/
vendor/
.phpunit.cache/
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## UNRELEASED

- Added support for Laravel 11

## v10.0.0 - 2023-02-19

- Added support for Laravel 10
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

[![Latest Version on Packagist][ico-version]][link-packagist]
[![Software License][ico-license]](LICENSE.md)
![Build Status](https://github.com/yajra/laravel-acl/workflows/tests/badge.svg)

[![Continuous Integration](https://github.com/yajra/laravel-acl/actions/workflows/continuous-integration.yml/badge.svg)](https://github.com/yajra/laravel-acl/actions/workflows/continuous-integration.yml)
[![Static Analysis](https://github.com/yajra/laravel-acl/actions/workflows/static-analysis.yml/badge.svg)](https://github.com/yajra/laravel-acl/actions/workflows/static-analysis.yml)
[![Total Downloads][ico-downloads]][link-downloads]

Laravel ACL (Access Control List) is a simple role-permission ACL for the Laravel Framework.
Expand All @@ -18,13 +20,14 @@ This package was based on the great package [Caffeinated/Shinobi](https://github
| 8.x and below | 6.x |
| 9.x | 9.x |
| 10.x | 10.x |
| 11.x | 11.x |

## Installation

Via Composer

``` bash
$ composer require yajra/laravel-acl
$ composer require yajra/laravel-acl:^11
```

## Configuration
Expand Down
130 changes: 75 additions & 55 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,58 +1,78 @@
{
"name": "yajra/laravel-acl",
"description": "Laravel ACL is a simple role, permission ACL for Laravel Framework.",
"keywords": [
"yajra",
"laravel",
"acl",
"user",
"role",
"permissions"
],
"homepage": "https://github.com/yajra/laravel-acl",
"license": "MIT",
"authors": [
{
"name": "Arjay Angeles",
"email": "aqangeles@gmail.com",
"homepage": "https://yajrabox.com",
"role": "Developer"
}
],
"require": {
"illuminate/support": "^10.0",
"illuminate/database": "^10.0"
},
"require-dev": {
"nunomaduro/larastan": "^2.4",
"orchestra/testbench": "^8.0"
},
"autoload": {
"psr-4": {
"Yajra\\Acl\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Yajra\\Acl\\Tests\\": "tests/"
}
},
"scripts": {
"test": "vendor/bin/phpunit"
},
"extra": {
"branch-alias": {
"dev-master": "10.0-dev"
"name": "yajra/laravel-acl",
"description": "Laravel ACL is a simple role, permission ACL for Laravel Framework.",
"keywords": [
"yajra",
"laravel",
"acl",
"user",
"role",
"permissions"
],
"homepage": "https://github.com/yajra/laravel-acl",
"license": "MIT",
"authors": [
{
"name": "Arjay Angeles",
"email": "aqangeles@gmail.com",
"homepage": "https://yajrabox.com",
"role": "Developer"
}
],
"require": {
"illuminate/support": "^11.0",
"illuminate/database": "^11.0"
},
"laravel": {
"providers": [
"Yajra\\Acl\\AclServiceProvider"
]
}
},
"config": {
"sort-packages": true
},
"minimum-stability": "dev",
"prefer-stable": true
"require-dev": {
"larastan/larastan": "^2.9.1",
"laravel/pint": "^1.14",
"rector/rector": "^1.0",
"orchestra/testbench": "^9.0"
},
"autoload": {
"psr-4": {
"Yajra\\Acl\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Yajra\\Acl\\Tests\\": "tests/"
}
},
"extra": {
"branch-alias": {
"dev-master": "11.x-dev"
},
"laravel": {
"providers": [
"Yajra\\Acl\\AclServiceProvider"
]
}
},
"config": {
"sort-packages": true,
"allow-plugins": {
"pestphp/pest-plugin": false
}
},
"minimum-stability": "dev",
"prefer-stable": true,
"scripts": {
"test": "./vendor/bin/phpunit",
"pint": "./vendor/bin/pint",
"rector": "./vendor/bin/rector",
"stan": "./vendor/bin/phpstan analyse --memory-limit=2G --ansi --no-progress --no-interaction --configuration=phpstan.neon.dist",
"pr": [
"@rector",
"@pint",
"@stan",
"@test"
]
},
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/yajra"
}
]
}
7 changes: 2 additions & 5 deletions migrations/2015_12_20_100001_create_permissions_table.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration {
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up(): void
{
Expand All @@ -24,8 +23,6 @@ public function up(): void

/**
* Reverse the migration.
*
* @return void
*/
public function down(): void
{
Expand Down
7 changes: 2 additions & 5 deletions migrations/2015_12_20_100002_create_roles_table.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration {
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up(): void
{
Expand All @@ -24,8 +23,6 @@ public function up(): void

/**
* Reverse the migration.
*
* @return void
*/
public function down(): void
{
Expand Down
7 changes: 2 additions & 5 deletions migrations/2015_12_20_100003_create_permission_role_table.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration {
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up(): void
{
Expand All @@ -22,8 +21,6 @@ public function up(): void

/**
* Reverse the migration.
*
* @return void
*/
public function down(): void
{
Expand Down
7 changes: 2 additions & 5 deletions migrations/2015_12_20_100004_create_role_user_table.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration {
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up(): void
{
Expand All @@ -22,8 +21,6 @@ public function up(): void

/**
* Reverse the migration.
*
* @return void
*/
public function down(): void
{
Expand Down
Loading
Loading