We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5f0b536 commit 631dcb1Copy full SHA for 631dcb1
src/PermissionServiceProvider.php
@@ -8,6 +8,7 @@
8
use Maklad\Permission\Contracts\PermissionInterface as Permission;
9
use Maklad\Permission\Contracts\RoleInterface as Role;
10
use Maklad\Permission\Directives\PermissionDirectives;
11
+use Illuminate\Support\Facades\DB;
12
13
/**
14
* Class PermissionServiceProvider
@@ -41,9 +42,12 @@ public function boot()
41
42
43
$this->registerModelBindings();
44
- $this->app->afterResolving(Gate::class, function () {
45
+ try {
46
+ DB::connection()->getPdo();
47
app(PermissionRegistrar::class)->registerPermissions();
- });
48
+ } catch (\Exception $e) {
49
+ die("Could not connect to the database. Please check your configuration. error:" . $e);
50
+ }
51
}
52
53
public function register()
0 commit comments