Skip to content

Commit 669cfad

Browse files
Merge pull request #118 from mostafamaklad/v3.0
V3.0
2 parents 5f0b536 + 0ed1138 commit 669cfad

File tree

4 files changed

+18
-14
lines changed

4 files changed

+18
-14
lines changed

CHANGELOG.md

Lines changed: 6 additions & 1 deletion
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+
## 3.0.0 - 2020-09-27
6+
7+
### Added
8+
- Support of Laravel 7.x
9+
510
## 2.0.1 - 2020-02-23
611

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

1217
### Added
13-
- Support of Laravel 6
18+
- Support of Laravel 6.x
1419

1520
## 1.10.1 - 2018-09-16
1621

README.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,16 +64,13 @@ $user->can('edit articles');
6464
## Installation
6565

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

6968
You can install the package via composer:
7069

7170
``` bash
7271
composer require mostafamaklad/laravel-permission-mongodb
7372
```
7473

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

7976
```bash

composer.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,16 @@
3030
}
3131
],
3232
"require": {
33-
"php": ">=7.1",
34-
"illuminate/auth": "^6.0",
35-
"illuminate/container": "^6.0",
36-
"illuminate/contracts": "^6.0",
33+
"php": ">=7.2",
34+
"illuminate/auth": "^6.0|^7.0",
35+
"illuminate/container": "^6.0|^7.0",
36+
"illuminate/contracts": "^6.0|^7.0",
3737
"jenssegers/mongodb": "^3.0"
3838
},
3939
"require-dev": {
40-
"monolog/monolog": "^1.23",
41-
"orchestra/testbench": "^4.0",
42-
"phpunit/phpunit": "^8.0",
40+
"monolog/monolog": "^1.23|^2.0",
41+
"orchestra/testbench": "^3.2|^4.0|^5.0",
42+
"phpunit/phpunit": "^5.7|^6.0|^7.0|^8.0",
4343
"squizlabs/php_codesniffer": "^3.1"
4444
},
4545
"autoload": {

src/PermissionServiceProvider.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
namespace Maklad\Permission;
44

5-
use Illuminate\Contracts\Auth\Access\Gate;
65
use Illuminate\Support\ServiceProvider;
76
use Illuminate\View\Compilers\BladeCompiler;
87
use Maklad\Permission\Contracts\PermissionInterface as Permission;
98
use Maklad\Permission\Contracts\RoleInterface as Role;
109
use Maklad\Permission\Directives\PermissionDirectives;
10+
use Illuminate\Support\Facades\DB;
1111

1212
/**
1313
* Class PermissionServiceProvider
@@ -41,9 +41,11 @@ public function boot()
4141

4242
$this->registerModelBindings();
4343

44-
$this->app->afterResolving(Gate::class, function () {
44+
try {
45+
DB::connection()->getPdo();
4546
app(PermissionRegistrar::class)->registerPermissions();
46-
});
47+
} catch (\Exception $e) {
48+
}
4749
}
4850

4951
public function register()

0 commit comments

Comments
 (0)