Skip to content

Commit

Permalink
Merge pull request #118 from mostafamaklad/v3.0
Browse files Browse the repository at this point in the history
V3.0
  • Loading branch information
mostafamaklad committed Sep 27, 2020
2 parents 5f0b536 + 0ed1138 commit 669cfad
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 14 deletions.
7 changes: 6 additions & 1 deletion 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.

## 3.0.0 - 2020-09-27

### Added
- Support of Laravel 7.x

## 2.0.1 - 2020-02-23

### Changed
Expand All @@ -10,7 +15,7 @@ All Notable changes to `laravel-permission-mongodb` will be documented in this f
## 2.0.0 - 2020-02-20

### Added
- Support of Laravel 6
- Support of Laravel 6.x

## 1.10.1 - 2018-09-16

Expand Down
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,13 @@ $user->can('edit articles');
## Installation

### Laravel
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
```

> For Laravel 5 use version 1.x
You can publish [the migration](database/migrations/create_permission_collections.php.stub) with:

```bash
Expand Down
14 changes: 7 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,16 @@
}
],
"require": {
"php": ">=7.1",
"illuminate/auth": "^6.0",
"illuminate/container": "^6.0",
"illuminate/contracts": "^6.0",
"php": ">=7.2",
"illuminate/auth": "^6.0|^7.0",
"illuminate/container": "^6.0|^7.0",
"illuminate/contracts": "^6.0|^7.0",
"jenssegers/mongodb": "^3.0"
},
"require-dev": {
"monolog/monolog": "^1.23",
"orchestra/testbench": "^4.0",
"phpunit/phpunit": "^8.0",
"monolog/monolog": "^1.23|^2.0",
"orchestra/testbench": "^3.2|^4.0|^5.0",
"phpunit/phpunit": "^5.7|^6.0|^7.0|^8.0",
"squizlabs/php_codesniffer": "^3.1"
},
"autoload": {
Expand Down
8 changes: 5 additions & 3 deletions src/PermissionServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

namespace Maklad\Permission;

use Illuminate\Contracts\Auth\Access\Gate;
use Illuminate\Support\ServiceProvider;
use Illuminate\View\Compilers\BladeCompiler;
use Maklad\Permission\Contracts\PermissionInterface as Permission;
use Maklad\Permission\Contracts\RoleInterface as Role;
use Maklad\Permission\Directives\PermissionDirectives;
use Illuminate\Support\Facades\DB;

/**
* Class PermissionServiceProvider
Expand Down Expand Up @@ -41,9 +41,11 @@ public function boot()

$this->registerModelBindings();

$this->app->afterResolving(Gate::class, function () {
try {
DB::connection()->getPdo();
app(PermissionRegistrar::class)->registerPermissions();
});
} catch (\Exception $e) {
}
}

public function register()
Expand Down

0 comments on commit 669cfad

Please sign in to comment.