File tree Expand file tree Collapse file tree 3 files changed +24
-1
lines changed Expand file tree Collapse file tree 3 files changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,9 @@ ROLES_PERMISSION_USER_DATABASE_TABLE=permission_user
14
14
# Roles Misc Settings
15
15
ROLES_DEFAULT_SEPARATOR = ' .'
16
16
17
+ # Roles Database Migrations Settings
18
+ ROLES_MIGRATION_DEFAULT_ENABLED = true
19
+
17
20
# Roles Database Seeder Settings
18
21
ROLES_SEED_DEFAULT_PERMISSIONS = true
19
22
ROLES_SEED_DEFAULT_ROLES = true
Original file line number Diff line number Diff line change @@ -49,14 +49,21 @@ public function boot()
49
49
public function register ()
50
50
{
51
51
$ this ->mergeConfigFrom (__DIR__ .'/config/roles.php ' , 'roles ' );
52
- $ this ->loadMigrationsFrom ( __DIR__ . ' /Database/Migrations ' );
52
+ $ this ->loadMigrations ( );
53
53
if (config ('roles.rolesGuiEnabled ' )) {
54
54
$ this ->loadViewsFrom (__DIR__ .'/resources/views/ ' , $ this ->_packageTag );
55
55
}
56
56
$ this ->publishFiles ();
57
57
$ this ->loadSeedsFrom ();
58
58
}
59
59
60
+ private function loadMigrations ()
61
+ {
62
+ if (config ('roles.defaultMigrations.enabled ' )) {
63
+ $ this ->loadMigrationsFrom (__DIR__ .'/Database/Migrations ' );
64
+ }
65
+ }
66
+
60
67
/**
61
68
* Loads a seeds.
62
69
*
Original file line number Diff line number Diff line change 69
69
'allowed ' => true ,
70
70
],
71
71
],
72
+ /*
73
+ |--------------------------------------------------------------------------
74
+ | Default Migrations
75
+ |--------------------------------------------------------------------------
76
+ |
77
+ | These are the default package migrations. If you publish the migrations
78
+ | to your project, then this is not necessary and should be disabled. This
79
+ | will enable our default migrations.
80
+ |
81
+ */
72
82
83
+ 'defaultMigrations ' => [
84
+ 'enabled ' => env ('ROLES_MIGRATION_DEFAULT_ENABLED ' , false ),
85
+ ],
73
86
/*
74
87
|--------------------------------------------------------------------------
75
88
| Default Seeds
You can’t perform that action at this time.
0 commit comments