Compare commits
2 Commits
Author | SHA1 | Date |
---|---|---|
![]() |
a050a9c222 | |
![]() |
434ee8003f |
|
@ -27,73 +27,7 @@ jobs:
|
||||||
# laravel: [ ]
|
# laravel: [ ]
|
||||||
# stability: [ prefer-lowest, prefer-stable ]
|
# stability: [ prefer-lowest, prefer-stable ]
|
||||||
include:
|
include:
|
||||||
# Laravel 5.5
|
|
||||||
- php: 7.1
|
|
||||||
laravel: 5.5.*
|
|
||||||
phpunit: ~6.0
|
|
||||||
- php: 7.2
|
|
||||||
laravel: 5.5.*
|
|
||||||
phpunit: ~6.0
|
|
||||||
- php: 7.3
|
|
||||||
laravel: 5.5.*
|
|
||||||
phpunit: ~6.0
|
|
||||||
|
|
||||||
# Laravel 5.6
|
|
||||||
- php: 7.1
|
|
||||||
laravel: 5.6.*
|
|
||||||
phpunit: ~7.0
|
|
||||||
- php: 7.2
|
|
||||||
laravel: 5.6.*
|
|
||||||
phpunit: ~7.0
|
|
||||||
- php: 7.3
|
|
||||||
laravel: 5.6.*
|
|
||||||
phpunit: ~7.0
|
|
||||||
|
|
||||||
# Laravel 5.7
|
|
||||||
- php: 7.1
|
|
||||||
laravel: 5.7.*
|
|
||||||
phpunit: ~7.5
|
|
||||||
- php: 7.2
|
|
||||||
laravel: 5.7.*
|
|
||||||
phpunit: ~7.5
|
|
||||||
- php: 7.3
|
|
||||||
laravel: 5.7.*
|
|
||||||
phpunit: ~7.5
|
|
||||||
|
|
||||||
# Laravel 5.8
|
|
||||||
- php: 7.1
|
|
||||||
laravel: 5.8.*
|
|
||||||
phpunit: ~7.5
|
|
||||||
- php: 7.2
|
|
||||||
laravel: 5.8.*
|
|
||||||
phpunit: ~8.0
|
|
||||||
- php: 7.3
|
|
||||||
laravel: 5.8.*
|
|
||||||
phpunit: ~8.0
|
|
||||||
|
|
||||||
# Laravel 6.x
|
|
||||||
- php: 7.2
|
|
||||||
laravel: 6.*
|
|
||||||
phpunit: ~8.0
|
|
||||||
- php: 7.3
|
|
||||||
laravel: 6.*
|
|
||||||
phpunit: ~8.0
|
|
||||||
|
|
||||||
# Laravel 7.x
|
|
||||||
- php: 7.3
|
|
||||||
laravel: 7.*
|
|
||||||
phpunit: ~9.0
|
|
||||||
- php: 7.4
|
|
||||||
laravel: 7.*
|
|
||||||
phpunit: ~9.0
|
|
||||||
|
|
||||||
# Laravel 8.x
|
# Laravel 8.x
|
||||||
- php: 7.3
|
|
||||||
laravel: 8.*
|
|
||||||
phpunit: ~9.0
|
|
||||||
- php: 7.4
|
|
||||||
laravel: 8.*
|
|
||||||
phpunit: ~9.0
|
|
||||||
- php: 8.0
|
- php: 8.0
|
||||||
laravel: 8.*
|
laravel: 8.*
|
||||||
phpunit: ~9.0
|
phpunit: ~9.0
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<a href="https://github.com/php-casbin/laravel-authz/actions">
|
<a href="https://github.com/php-casbin/laravel-authz/actions">
|
||||||
<img src="https://github.com/php-casbin/laravel-authz/workflows/build/badge.svg?branch=master" alt="Build Status">
|
<img src="https://github.com/php-casbin/laravel-authz/actions/workflows/build.yml/badge.svg?branch=master" alt="Build Status">
|
||||||
</a>
|
</a>
|
||||||
<a href="https://coveralls.io/github/php-casbin/laravel-authz">
|
<a href="https://coveralls.io/github/php-casbin/laravel-authz">
|
||||||
<img src="https://coveralls.io/repos/github/php-casbin/laravel-authz/badge.svg" alt="Coverage Status">
|
<img src="https://coveralls.io/repos/github/php-casbin/laravel-authz/badge.svg" alt="Coverage Status">
|
||||||
|
@ -35,6 +35,7 @@ All you need to learn to use `Casbin` first.
|
||||||
* [Using a middleware](#using-a-middleware)
|
* [Using a middleware](#using-a-middleware)
|
||||||
* [basic Enforcer Middleware](#basic-enforcer-middleware)
|
* [basic Enforcer Middleware](#basic-enforcer-middleware)
|
||||||
* [HTTP Request Middleware ( RESTful is also supported )](#http-request-middleware--restful-is-also-supported-)
|
* [HTTP Request Middleware ( RESTful is also supported )](#http-request-middleware--restful-is-also-supported-)
|
||||||
|
* [Using Gates](#using-gates)
|
||||||
* [Multiple enforcers](#multiple-enforcers)
|
* [Multiple enforcers](#multiple-enforcers)
|
||||||
* [Using artisan commands](#using-artisan-commands)
|
* [Using artisan commands](#using-artisan-commands)
|
||||||
* [Cache](#using-cache)
|
* [Cache](#using-cache)
|
||||||
|
|
|
@ -20,18 +20,17 @@
|
||||||
],
|
],
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=7.1.0",
|
"php": ">=8.0",
|
||||||
"illuminate/support": "~5.5|~6.0|~7.0|~8.0|~9.0|~10.0|~11.0",
|
"illuminate/support": "~8.0|~9.0|~10.0|~11.0",
|
||||||
"illuminate/database": "~5.5|~6.0|~7.0|~8.0|~9.0|~10.0|~11.0",
|
"illuminate/database": "~8.0|~9.0|~10.0|~11.0",
|
||||||
"illuminate/console": "~5.5|~6.0|~7.0|~8.0|~9.0|~10.0|~11.0",
|
"illuminate/console": "~8.0|~9.0|~10.0|~11.0",
|
||||||
"casbin/casbin": "~3.1",
|
"casbin/casbin": "~4.0"
|
||||||
"casbin/psr3-bridge": "^1.1"
|
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"phpunit/phpunit": "~7.0|~8.0|~9.0|~10.5",
|
"phpunit/phpunit": "~9.0|~10.5",
|
||||||
"php-coveralls/php-coveralls": "^2.4",
|
"php-coveralls/php-coveralls": "^2.7",
|
||||||
"mockery/mockery": "^1.0",
|
"mockery/mockery": "^1.0",
|
||||||
"laravel/laravel": "~5.5|~6.0|~7.0|~8.0|~9.0|~10.0|~11.0"
|
"laravel/laravel": "~9.0|~10.0|~11.0"
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
|
|
|
@ -2,10 +2,10 @@
|
||||||
|
|
||||||
namespace Lauthz;
|
namespace Lauthz;
|
||||||
|
|
||||||
use Casbin\Bridge\Logger\LoggerBridge;
|
|
||||||
use Casbin\Enforcer;
|
use Casbin\Enforcer;
|
||||||
use Casbin\Model\Model;
|
use Casbin\Model\Model;
|
||||||
use Casbin\Log\Log;
|
use Casbin\Log\Log;
|
||||||
|
use Casbin\Log\Logger\DefaultLogger;
|
||||||
use Lauthz\Contracts\Factory;
|
use Lauthz\Contracts\Factory;
|
||||||
use Lauthz\Models\Rule;
|
use Lauthz\Models\Rule;
|
||||||
use Illuminate\Support\Arr;
|
use Illuminate\Support\Arr;
|
||||||
|
@ -80,10 +80,10 @@ class EnforcerManager implements Factory
|
||||||
|
|
||||||
if ($logger = Arr::get($config, 'log.logger')) {
|
if ($logger = Arr::get($config, 'log.logger')) {
|
||||||
if (is_string($logger)) {
|
if (is_string($logger)) {
|
||||||
$logger = $this->app->make($logger);
|
$logger = new DefaultLogger($this->app->make($logger));
|
||||||
}
|
}
|
||||||
|
|
||||||
Log::setLogger(new LoggerBridge($logger));
|
Log::setLogger($logger);
|
||||||
}
|
}
|
||||||
|
|
||||||
$model = new Model();
|
$model = new Model();
|
||||||
|
@ -98,7 +98,7 @@ class EnforcerManager implements Factory
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
return new Enforcer($model, $adapter, Arr::get($config, 'log.enabled', false));
|
return new Enforcer($model, $adapter, $logger, Arr::get($config, 'log.enabled', false));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -2,11 +2,9 @@
|
||||||
|
|
||||||
namespace Lauthz\Tests;
|
namespace Lauthz\Tests;
|
||||||
|
|
||||||
use Enforcer;
|
|
||||||
use Lauthz\Models\Rule;
|
use Lauthz\Models\Rule;
|
||||||
use Illuminate\Foundation\Testing\DatabaseMigrations;
|
use Illuminate\Foundation\Testing\DatabaseMigrations;
|
||||||
use Casbin\Persist\Adapters\Filter;
|
use Lauthz\Facades\Enforcer;
|
||||||
use Casbin\Exceptions\InvalidFilterTypeException;
|
|
||||||
|
|
||||||
class DatabaseAdapterForCacheTest extends TestCase
|
class DatabaseAdapterForCacheTest extends TestCase
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue