@@ -28,13 +28,13 @@ The user with the lowest primary key will be set up as the SuperAdmin. If you're
28
28
have users, you can update the role-user entry to point to your intended user,
29
29
if the first user is not the intended SuperAdmin. Now let's get the package
30
30
installed.
31
-
31
+
32
32
Install via composer:
33
33
``` sh
34
34
composer require genealabs/laravel-governor
35
35
```
36
36
37
- Add the service provider to your app.php config file:
37
+ ** ONLY FOR LARVEL 5.4 AND LOWER: ** Add the service provider to your app.php config file:
38
38
``` php
39
39
'providers' => [
40
40
// [...]
@@ -43,29 +43,39 @@ Add the service provider to your app.php config file:
43
43
],
44
44
```
45
45
46
- Before we can get started, we need to update the database by running the migrations and data seeders:
47
- ``` sh
48
- php artisan migrate
49
- php artisan db:seed --class=LaravelGovernorDatabaseSeeder
50
- ```
51
-
52
- Now we need to make the assets available:
53
- ``` sh
54
- php artisan governor:publish --assets
55
- ```
56
-
57
- Lastly, add the Governable trait to the User model of your app:
58
- ``` php
59
- // [...]
60
- use GeneaLabs\LaravelGovernor\Traits\Governable;
61
-
62
- class User extends Authenticatable
63
- {
64
- use Governable;
65
- // [...]
66
- ```
67
-
68
46
## Implementation
47
+ 1 . First we need to update the database by running the migrations and data seeders:
48
+ ``` sh
49
+ php artisan migrate
50
+ php artisan db:seed --class=LaravelGovernorDatabaseSeeder
51
+ ```
52
+
53
+ 2. If you are starting out with an empty database, run your seeders now:
54
+ ` ` ` sh
55
+ php artisan db:seed
56
+ ` ` `
57
+
58
+ 3. Next, assign permissions (this requires you have users already populated):
59
+ ` ` ` sh
60
+ php artisan db:seed --class=LaravelGovernorPermissionsTableSeeder
61
+ ` ` `
62
+
63
+ 4. Now we need to make the assets available:
64
+ ` ` ` sh
65
+ php artisan governor:publish --assets
66
+ ` ` `
67
+
68
+ 5. Lastly, add the Governable trait to the User model of your app:
69
+ ` ` ` php
70
+ // [...]
71
+ use GeneaLabs\L aravelGovernor\T raits\G overnable;
72
+
73
+ class User extends Authenticatable
74
+ {
75
+ use Governable;
76
+ // [...]
77
+ ` ` `
78
+
69
79
# ## Configuration
70
80
If you need to make any changes (see Example selection below for the default
71
81
config file) to the default configuration, publish the configuration file:
0 commit comments