Skip to content

Commit

Permalink
V2.0 (#101)
Browse files Browse the repository at this point in the history
* ⬆️ Support for laravel 6

* remove travis ci
  • Loading branch information
mostafamaklad committed Feb 20, 2020
1 parent bec3d0e commit 2c5427e
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 70 deletions.
40 changes: 0 additions & 40 deletions .travis.yml

This file was deleted.

5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

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

## 2.0.0 - 2018-11-16

### Added
- Support of Laravel 6

## 1.10.1 - 2018-09-16

### Fixed
Expand Down
11 changes: 2 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,22 +64,15 @@ $user->can('edit articles');
## Installation

### Laravel
This package can be used in Laravel 5.2 and up.
This package can be used in Laravel 6.x and up.

You can install the package via composer:

``` bash
composer require mostafamaklad/laravel-permission-mongodb
```

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:

```php
'providers' => [
// ...
Maklad\Permission\PermissionServiceProvider::class,
];
```
> For Laravel 5 use version 1.x
You can publish [the migration](database/migrations/create_permission_collections.php.stub) with:

Expand Down
16 changes: 7 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,17 @@
}
],
"require": {
"php": ">=7.0",
"illuminate/auth": "^5.2.0",
"illuminate/container": "^5.2.0",
"illuminate/contracts": "^5.2.0",
"php": ">=7.1",
"illuminate/auth": "^6.0",
"illuminate/container": "^6.0",
"illuminate/contracts": "^6.0",
"jenssegers/mongodb": "^3.0"
},
"require-dev": {
"codeclimate/php-test-reporter": "^0.4.4",
"monolog/monolog": "^1.23",
"orchestra/testbench": "^3.2.0",
"phpunit/phpunit": "^5.7|^6.0|^7.0",
"squizlabs/php_codesniffer": "^3.1",
"codacy/coverage": "dev-master"
"orchestra/testbench": "^4.0",
"phpunit/phpunit": "^8.0",
"squizlabs/php_codesniffer": "^3.1"
},
"autoload": {
"psr-4": {
Expand Down
3 changes: 1 addition & 2 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
backupGlobals="false"
backupStaticAttributes="false"
colors="true"
syntaxCheck="false"
verbose="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
Expand All @@ -23,7 +22,7 @@
<logging>
<log type="tap" target="build/report.tap"/>
<log type="junit" target="build/report.junit.xml"/>
<log type="coverage-html" target="build/coverage" charset="UTF-8" yui="true" highlight="true"/>
<log type="coverage-html" target="build/coverage"/>
<log type="coverage-text" target="build/coverage.txt"/>
<log type="coverage-clover" target="build/logs/clover.xml"/>
</logging>
Expand Down
2 changes: 1 addition & 1 deletion tests/BladeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

class BladeTest extends TestCase
{
public function setUp()
public function setUp(): void
{
parent::setUp();

Expand Down
2 changes: 1 addition & 1 deletion tests/CacheTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class CacheTest extends TestCase
{
protected $registrar;

public function setUp()
public function setUp(): void
{
parent::setUp();

Expand Down
2 changes: 1 addition & 1 deletion tests/MiddlewareTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class MiddlewareTest extends TestCase
protected $roleMiddleware;
protected $permissionMiddleware;

public function setUp()
public function setUp(): void
{
parent::setUp();

Expand Down
2 changes: 1 addition & 1 deletion tests/RoleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

class RoleTest extends TestCase
{
public function setUp()
public function setUp(): void
{
parent::setUp();

Expand Down
12 changes: 6 additions & 6 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ abstract class TestCase extends Orchestra
/**
* Flush the database after each test function
*/
public function tearDown()
public function tearDown(): void
{
User::truncate();
Admin::truncate();
Expand All @@ -44,7 +44,7 @@ public function tearDown()
/** @var \Maklad\Permission\Models\Permission */
protected $testAdminPermission;

public function setUp()
public function setUp(): void
{
parent::setUp();

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

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

/**
Expand Down Expand Up @@ -157,7 +157,7 @@ public function refreshTestAdmin()

protected function clearLogTestHandler()
{
\collect($this->app['log']->getMonolog()->getHandlers())->filter(function ($handler) {
\collect($this->app['log']->getLogger()->getHandlers())->filter(function ($handler) {
return $handler instanceof TestHandler;
})->first()->clear();
}
Expand All @@ -180,7 +180,7 @@ protected function assertLogged($message, $level)
*/
protected function hasLog($message, $level)
{
return \collect($this->app['log']->getMonolog()->getHandlers())->filter(function ($handler) use (
return \collect($this->app['log']->getLogger()->getHandlers())->filter(function ($handler) use (
$message,
$level
) {
Expand Down Expand Up @@ -208,7 +208,7 @@ protected function assertShowPermission($message, $role_permission)
if (\config('permission.display_permission_in_exception')) {
$this->assertContains($role_permission, $message);
} else {
$this->assertNotContains($role_permission, $message);
$this->assertStringNotContainsString($role_permission, $message);
}
}

Expand Down

0 comments on commit 2c5427e

Please sign in to comment.