Skip to content

Commit

Permalink
Merge pull request #983 from sunergix/feature-laravel-11-support
Browse files Browse the repository at this point in the history
Laravel 11 support
  • Loading branch information
andrewelkins authored Aug 29, 2024
2 parents ba92414 + 50fa5e4 commit 7937e4e
Show file tree
Hide file tree
Showing 14 changed files with 3,007 additions and 1,120 deletions.
1 change: 1 addition & 0 deletions .phpunit.result.cache
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"version":1,"defects":{"EntrustTest::testRouteNeedsRole":5,"EntrustTest::testRouteNeedsPermission":5,"EntrustTest::testRouteNeedsRoleOrPermission":5,"EntrustUserTest::testCan":8,"EntrustUserTest::testCanWithPlaceholderSupport":8,"EntrustUserTest::testAbilityShouldReturnBoolean":8,"EntrustUserTest::testAbilityShouldReturnArray":8,"EntrustUserTest::testAbilityShouldReturnBoth":8,"EntrustUserTest::testAbilityShouldAcceptStrings":8,"EntrustUserTest::testAbilityDefaultOptions":8,"EntrustUserTest::testAttachRole":5,"EntrustUserTest::testDetachRole":5,"EntrustUserTest::testAttachRoles":5,"EntrustUserTest::testDetachRoles":5,"EntrustUserTest::testDetachAllRoles":5},"times":{"EntrustTest::testHasRole":0.005,"EntrustTest::testCan":0,"EntrustTest::testUser":0.001,"EntrustTest::testRouteNeedsRole":0.001,"EntrustTest::testRouteNeedsPermission":0,"EntrustTest::testRouteNeedsRoleOrPermission":0,"EntrustUserTest::testRoles":0.001,"EntrustUserTest::testHasRole":0.002,"EntrustUserTest::testCan":0.003,"EntrustUserTest::testCanWithPlaceholderSupport":0,"EntrustUserTest::testAbilityShouldReturnBoolean":0.001,"EntrustUserTest::testAbilityShouldReturnArray":0.001,"EntrustUserTest::testAbilityShouldReturnBoth":0.001,"EntrustUserTest::testAbilityShouldAcceptStrings":0,"EntrustUserTest::testAbilityDefaultOptions":0.001,"EntrustUserTest::testAbilityShouldThrowInvalidArgumentException":0,"EntrustUserTest::testAttachRole":0.001,"EntrustUserTest::testDetachRole":0,"EntrustUserTest::testAttachRoles":0,"EntrustUserTest::testDetachRoles":0,"EntrustUserTest::testDetachAllRoles":0.001,"EntrustAbilityTest::testHandle_IsGuestWithNoAbility_ShouldAbort403":0.002,"EntrustAbilityTest::testHandle_IsGuestWithAbility_ShouldAbort403":0.001,"EntrustAbilityTest::testHandle_IsLoggedInWithNoAbility_ShouldAbort403":0,"EntrustAbilityTest::testHandle_IsLoggedInWithAbility_ShouldNotAbort":0,"EntrustPermissionTest::testHandle_IsGuestWithNoPermission_ShouldAbort403":0,"EntrustPermissionTest::testHandle_IsGuestWithPermission_ShouldAbort403":0,"EntrustPermissionTest::testHandle_IsLoggedInWithNoPermission_ShouldAbort403":0,"EntrustPermissionTest::testHandle_IsLoggedInWithPermission_ShouldNotAbort":0,"EntrustRoleTest::testHandle_IsGuestWithMismatchingRole_ShouldAbort403":0,"EntrustRoleTest::testHandle_IsGuestWithMatchingRole_ShouldAbort403":0,"EntrustRoleTest::testHandle_IsLoggedInWithMismatchRole_ShouldAbort403":0,"EntrustRoleTest::testHandle_IsLoggedInWithMatchingRole_ShouldNotAbort":0,"EntrustTest::testFilterGeneratedByRouteNeedsRoleOrPermission#0":0.001,"EntrustTest::testFilterGeneratedByRouteNeedsRoleOrPermission#1":0,"EntrustTest::testFilterGeneratedByRouteNeedsRoleOrPermission#2":0,"EntrustTest::testFilterGeneratedByRouteNeedsRoleOrPermission#3":0,"EntrustTest::testFilterGeneratedByRouteNeedsRoleOrPermission#4":0,"EntrustTest::testFilterGeneratedByRouteNeedsRoleOrPermission#5":0,"EntrustTest::testFilterGeneratedByRouteNeedsRoleOrPermission#6":0,"EntrustTest::testFilterGeneratedByRouteNeedsRoleOrPermission#7":0,"EntrustTest::testFilterGeneratedByRouteNeedsRoleOrPermission#8":0,"EntrustTest::testFilterGeneratedByRouteNeedsRoleOrPermission#9":0,"EntrustTest::testFilterGeneratedByRouteNeedsRoleOrPermission#10":0,"EntrustTest::testFilterGeneratedByRouteNeedsRoleOrPermission#11":0,"EntrustTest::testFilterGeneratedByRouteNeedsRole#0":0.002,"EntrustTest::testFilterGeneratedByRouteNeedsRole#1":0,"EntrustTest::testFilterGeneratedByRouteNeedsRole#2":0,"EntrustTest::testFilterGeneratedByRouteNeedsPermission#0":0.001,"EntrustTest::testFilterGeneratedByRouteNeedsPermission#1":0,"EntrustTest::testFilterGeneratedByRouteNeedsPermission#2":0}}
53 changes: 24 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,34 @@
# ENTRUST (Laravel 5 Package)
# ENTRUST (Laravel 9|10 Package)

[![Build Status](https://travis-ci.org/Zizaco/entrust.svg)](https://travis-ci.org/Zizaco/entrust)
[![Version](https://img.shields.io/packagist/v/Zizaco/entrust.svg)](https://packagist.org/packages/zizaco/entrust)
[![License](https://poser.pugx.org/zizaco/entrust/license.svg)](https://packagist.org/packages/zizaco/entrust)
[![Total Downloads](https://img.shields.io/packagist/dt/zizaco/entrust.svg)](https://packagist.org/packages/zizaco/entrust)
Forked from [zizaco/entrust](https://github.com/Zizaco/entrust)

[![SensioLabsInsight](https://insight.sensiolabs.com/projects/cc4af966-809b-4fbc-b8b2-bb2850e6711e/small.png)](https://insight.sensiolabs.com/projects/cc4af966-809b-4fbc-b8b2-bb2850e6711e)
Entrust is a succinct and flexible way to add Role-based Permissions to **Laravel 9|10**.

Entrust is a succinct and flexible way to add Role-based Permissions to **Laravel 5**.

If you are looking for the Laravel 4 version, take a look [Branch 1.0](https://github.com/Zizaco/entrust/tree/1.0). It
contains the latest entrust version for Laravel 4.
If you are using an older version of laravel, use version ~3.0

## Contents

- [Installation](#installation)
- [Configuration](#configuration)
- [ENTRUST (Laravel 9|10 Package)](#entrust-laravel-910-package)
- [Contents](#contents)
- [Installation](#installation)
- [Configuration](#configuration)
- [User relation to roles](#user-relation-to-roles)
- [Models](#models)
- [Role](#role)
- [Permission](#permission)
- [User](#user)
- [Soft Deleting](#soft-deleting)
- [Usage](#usage)
- [Role](#role)
- [Permission](#permission)
- [User](#user)
- [Soft Deleting](#soft-deleting)
- [Usage](#usage)
- [Concepts](#concepts)
- [Checking for Roles & Permissions](#checking-for-roles--permissions)
- [User ability](#user-ability)
- [Checking for Roles \& Permissions](#checking-for-roles--permissions)
- [User ability](#user-ability)
- [Blade templates](#blade-templates)
- [Middleware](#middleware)
- [Short syntax route filter](#short-syntax-route-filter)
- [Route filter](#route-filter)
- [Troubleshooting](#troubleshooting)
- [License](#license)
- [Contribution guidelines](#contribution-guidelines)
- [Additional information](#additional-information)
- [Troubleshooting](#troubleshooting)
- [License](#license)
- [Contribution guidelines](#contribution-guidelines)

## Installation

Expand All @@ -49,7 +44,7 @@ contains the latest entrust version for Laravel 4.
Zizaco\Entrust\EntrustServiceProvider::class,
```

3) In the same `config/app.php` and add the following to the `aliases ` array:
3) In the same `config/app.php` and add the following to the `aliases ` array:

```php
'Entrust' => Zizaco\Entrust\EntrustFacade::class,
Expand Down Expand Up @@ -389,18 +384,18 @@ Three directives are available for use within your Blade templates. What you giv

```php
@role('admin')
<p>This is visible to users with the admin role. Gets translated to
<p>This is visible to users with the admin role. Gets translated to
\Entrust::role('admin')</p>
@endrole

@permission('manage-admins')
<p>This is visible to users with the given permissions. Gets translated to
\Entrust::can('manage-admins'). The @can directive is already taken by core
<p>This is visible to users with the given permissions. Gets translated to
\Entrust::can('manage-admins'). The @can directive is already taken by core
laravel authorization package, hence the @permission directive instead.</p>
@endpermission

@ability('admin,owner', 'create-post,edit-user')
<p>This is visible to users with the given abilities. Gets translated to
<p>This is visible to users with the given abilities. Gets translated to
\Entrust::ability('admin,owner', 'create-post,edit-user')</p>
@endability
```
Expand Down Expand Up @@ -550,5 +545,5 @@ Entrust is free software distributed under the terms of the MIT license.

Support follows PSR-1 and PSR-4 PHP coding standards, and semantic versioning.

Please report any issue you find in the issues page.
Please report any issue you find in the issues page.
Pull requests are welcome.
25 changes: 14 additions & 11 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "zizaco/entrust",
"description": "This package provides a flexible way to add Role-based Permissions to Laravel",
"name": "sunergix/entrust-permissions",
"description": "This package provides a flexible way to add Role-based Permissions to Laravel. Supports laravel 5|6|7|8",
"keywords": ["laravel","illuminate","auth","roles","acl","permission"],
"license": "MIT",
"authors": [
Expand All @@ -19,19 +19,22 @@
{
"name": "Michele Angioni",
"email": "[email protected]"
},
{
"name": "Edwin Karanja",
"email": "[email protected]"
}
],
"require": {
"php": ">=5.5.0",
"illuminate/console": "~5.0",
"illuminate/support": "~5.0",
"illuminate/cache": "~5.0"
"php": "^8.2",
"illuminate/console": "^11",
"illuminate/support": "^11",
"illuminate/cache": "^11",
"illuminate/database": "^11"
},
"require-dev": {
"phpunit/phpunit": "~4.1",
"mockery/mockery": "dev-master",
"illuminate/database": "~5.0",
"sami/sami": "dev-master"
"phpunit/phpunit": "^11",
"mockery/mockery": "^1.5"
},
"autoload": {
"classmap": [
Expand All @@ -56,5 +59,5 @@
"tests/Middleware/MiddlewareTest.php"
]
},
"minimum-stability": "dev"
"minimum-stability": "stable"
}
Loading

0 comments on commit 7937e4e

Please sign in to comment.