Skip to content

Commit 54d8ea6

Browse files
V2.0 (#101)
* ⬆️ Support for laravel 6 * remove travis ci
1 parent 06d4b19 commit 54d8ea6

File tree

10 files changed

+25
-70
lines changed

10 files changed

+25
-70
lines changed

.travis.yml

Lines changed: 0 additions & 40 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
All Notable changes to `laravel-permission-mongodb` will be documented in this file.
44

5+
## 2.0.0 - 2018-11-16
6+
7+
### Added
8+
- Support of Laravel 6
9+
510
## 1.10.1 - 2018-09-16
611

712
### Fixed

README.md

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -64,22 +64,15 @@ $user->can('edit articles');
6464
## Installation
6565

6666
### Laravel
67-
This package can be used in Laravel 5.2 and up.
67+
This package can be used in Laravel 6.x and up.
6868

6969
You can install the package via composer:
7070

7171
``` bash
7272
composer require mostafamaklad/laravel-permission-mongodb
7373
```
7474

75-
In Laravel 5.5 the service provider will automatically get registered. In older versions of the framework just add the service provider in `config/app.php` file:
76-
77-
```php
78-
'providers' => [
79-
// ...
80-
Maklad\Permission\PermissionServiceProvider::class,
81-
];
82-
```
75+
> For Laravel 5 use version 1.x
8376
8477
You can publish [the migration](database/migrations/create_permission_collections.php.stub) with:
8578

composer.json

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,17 @@
3030
}
3131
],
3232
"require": {
33-
"php": ">=7.0",
34-
"illuminate/auth": "^5.2.0",
35-
"illuminate/container": "^5.2.0",
36-
"illuminate/contracts": "^5.2.0",
33+
"php": ">=7.1",
34+
"illuminate/auth": "^6.0",
35+
"illuminate/container": "^6.0",
36+
"illuminate/contracts": "^6.0",
3737
"jenssegers/mongodb": "^3.0"
3838
},
3939
"require-dev": {
40-
"codeclimate/php-test-reporter": "^0.4.4",
4140
"monolog/monolog": "^1.23",
42-
"orchestra/testbench": "^3.2.0",
43-
"phpunit/phpunit": "^5.7|^6.0|^7.0",
44-
"squizlabs/php_codesniffer": "^3.1",
45-
"codacy/coverage": "dev-master"
41+
"orchestra/testbench": "^4.0",
42+
"phpunit/phpunit": "^8.0",
43+
"squizlabs/php_codesniffer": "^3.1"
4644
},
4745
"autoload": {
4846
"psr-4": {

phpunit.xml.dist

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
backupGlobals="false"
44
backupStaticAttributes="false"
55
colors="true"
6-
syntaxCheck="false"
76
verbose="true"
87
convertErrorsToExceptions="true"
98
convertNoticesToExceptions="true"
@@ -23,7 +22,7 @@
2322
<logging>
2423
<log type="tap" target="build/report.tap"/>
2524
<log type="junit" target="build/report.junit.xml"/>
26-
<log type="coverage-html" target="build/coverage" charset="UTF-8" yui="true" highlight="true"/>
25+
<log type="coverage-html" target="build/coverage"/>
2726
<log type="coverage-text" target="build/coverage.txt"/>
2827
<log type="coverage-clover" target="build/logs/clover.xml"/>
2928
</logging>

tests/BladeTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
class BladeTest extends TestCase
99
{
10-
public function setUp()
10+
public function setUp(): void
1111
{
1212
parent::setUp();
1313

tests/CacheTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class CacheTest extends TestCase
1111
{
1212
protected $registrar;
1313

14-
public function setUp()
14+
public function setUp(): void
1515
{
1616
parent::setUp();
1717

tests/MiddlewareTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class MiddlewareTest extends TestCase
1515
protected $roleMiddleware;
1616
protected $permissionMiddleware;
1717

18-
public function setUp()
18+
public function setUp(): void
1919
{
2020
parent::setUp();
2121

tests/RoleTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
class RoleTest extends TestCase
1313
{
14-
public function setUp()
14+
public function setUp(): void
1515
{
1616
parent::setUp();
1717

tests/TestCase.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ abstract class TestCase extends Orchestra
1818
/**
1919
* Flush the database after each test function
2020
*/
21-
public function tearDown()
21+
public function tearDown(): void
2222
{
2323
User::truncate();
2424
Admin::truncate();
@@ -44,7 +44,7 @@ public function tearDown()
4444
/** @var \Maklad\Permission\Models\Permission */
4545
protected $testAdminPermission;
4646

47-
public function setUp()
47+
public function setUp(): void
4848
{
4949
parent::setUp();
5050

@@ -103,7 +103,7 @@ protected function getEnvironmentSetUp($app)
103103
// Use test User model for users provider
104104
$app['config']->set('auth.providers.users.model', User::class);
105105

106-
$app['log']->getMonolog()->pushHandler(new TestHandler());
106+
$app['log']->getLogger()->pushHandler(new TestHandler());
107107
}
108108

109109
/**
@@ -157,7 +157,7 @@ public function refreshTestAdmin()
157157

158158
protected function clearLogTestHandler()
159159
{
160-
\collect($this->app['log']->getMonolog()->getHandlers())->filter(function ($handler) {
160+
\collect($this->app['log']->getLogger()->getHandlers())->filter(function ($handler) {
161161
return $handler instanceof TestHandler;
162162
})->first()->clear();
163163
}
@@ -180,7 +180,7 @@ protected function assertLogged($message, $level)
180180
*/
181181
protected function hasLog($message, $level)
182182
{
183-
return \collect($this->app['log']->getMonolog()->getHandlers())->filter(function ($handler) use (
183+
return \collect($this->app['log']->getLogger()->getHandlers())->filter(function ($handler) use (
184184
$message,
185185
$level
186186
) {
@@ -208,7 +208,7 @@ protected function assertShowPermission($message, $role_permission)
208208
if (\config('permission.display_permission_in_exception')) {
209209
$this->assertContains($role_permission, $message);
210210
} else {
211-
$this->assertNotContains($role_permission, $message);
211+
$this->assertStringNotContainsString($role_permission, $message);
212212
}
213213
}
214214

0 commit comments

Comments
 (0)