updated laratrust version

This commit is contained in:
Denis Duliçi 2020-12-14 15:11:38 +03:00
parent 7e9bed8bad
commit 348e957735
3 changed files with 10 additions and 19 deletions

View File

@ -2,8 +2,6 @@
namespace App\Providers; namespace App\Providers;
use Illuminate\Contracts\Auth\Access\Authorizable;
use Illuminate\Contracts\Auth\Access\Gate;
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as Provider; use Illuminate\Foundation\Support\Providers\AuthServiceProvider as Provider;
class Auth extends Provider class Auth extends Provider
@ -25,12 +23,5 @@ class Auth extends Provider
public function boot() public function boot()
{ {
$this->registerPolicies(); $this->registerPolicies();
// Register permissions to Laravel Gate
app(Gate::class)->before(function (Authorizable $user, string $ability) {
if (method_exists($user, 'hasPermission')) {
return $user->hasPermission($ability) ?: null;
}
});
} }
} }

View File

@ -49,7 +49,7 @@
"monooso/unobserve": "^3.0", "monooso/unobserve": "^3.0",
"plank/laravel-mediable": "4.4.*", "plank/laravel-mediable": "4.4.*",
"riverskies/laravel-mobile-detect": "^1.3", "riverskies/laravel-mobile-detect": "^1.3",
"santigarcor/laratrust": "6.2.*", "santigarcor/laratrust": "6.3.*",
"simshaun/recurr": "4.0.*", "simshaun/recurr": "4.0.*",
"staudenmeir/belongs-to-through": "^2.11", "staudenmeir/belongs-to-through": "^2.11",
"staudenmeir/eloquent-has-many-deep": "^1.13" "staudenmeir/eloquent-has-many-deep": "^1.13"

18
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "51666397fc0545e8e14af377d5486a5f", "content-hash": "4ace9899196a414a1d402f38b3687252",
"packages": [ "packages": [
{ {
"name": "akaunting/firewall", "name": "akaunting/firewall",
@ -8229,25 +8229,25 @@
}, },
{ {
"name": "santigarcor/laratrust", "name": "santigarcor/laratrust",
"version": "6.2.2", "version": "6.3.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/santigarcor/laratrust.git", "url": "https://github.com/santigarcor/laratrust.git",
"reference": "dfc2f0880c827bd20607fd4bfbe8ac471de29800" "reference": "dcb43416ecfeacb67e056423780e288c325e9c82"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/santigarcor/laratrust/zipball/dfc2f0880c827bd20607fd4bfbe8ac471de29800", "url": "https://api.github.com/repos/santigarcor/laratrust/zipball/dcb43416ecfeacb67e056423780e288c325e9c82",
"reference": "dfc2f0880c827bd20607fd4bfbe8ac471de29800", "reference": "dcb43416ecfeacb67e056423780e288c325e9c82",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"kkszymanowski/traitor": "^0.2.0", "kkszymanowski/traitor": "^0.2.0",
"laravel/framework": "~6.0|~7.0|~8.0", "laravel/framework": "~6.0|~7.0|~8.0",
"php": "^7.2" "php": ">=7.2"
}, },
"require-dev": { "require-dev": {
"mockery/mockery": "^1.3.1", "mockery/mockery": "^1.3.2",
"orchestra/testbench": "4.*|5.*|6.*", "orchestra/testbench": "4.*|5.*|6.*",
"phpunit/phpunit": "^7.5.15|^8.4|^9.0" "phpunit/phpunit": "^7.5.15|^8.4|^9.0"
}, },
@ -8292,7 +8292,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/santigarcor/laratrust/issues", "issues": "https://github.com/santigarcor/laratrust/issues",
"source": "https://github.com/santigarcor/laratrust/tree/6.2.2" "source": "https://github.com/santigarcor/laratrust/tree/6.3.1"
}, },
"funding": [ "funding": [
{ {
@ -8300,7 +8300,7 @@
"type": "github" "type": "github"
} }
], ],
"time": "2020-09-15T13:30:03+00:00" "time": "2020-12-09T14:25:23+00:00"
}, },
{ {
"name": "seld/jsonlint", "name": "seld/jsonlint",