Skip to content

Commit 93b269a

Browse files
committed
Update readme
1 parent 1a4e3fc commit 93b269a

File tree

1 file changed

+34
-24
lines changed

1 file changed

+34
-24
lines changed

README.md

+34-24
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ The user with the lowest primary key will be set up as the SuperAdmin. If you're
2828
have users, you can update the role-user entry to point to your intended user,
2929
if the first user is not the intended SuperAdmin. Now let's get the package
3030
installed.
31-
31+
3232
Install via composer:
3333
```sh
3434
composer require genealabs/laravel-governor
3535
```
3636

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:
3838
```php
3939
'providers' => [
4040
// [...]
@@ -43,29 +43,39 @@ Add the service provider to your app.php config file:
4343
],
4444
```
4545

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-
6846
## 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\LaravelGovernor\Traits\Governable;
72+
73+
class User extends Authenticatable
74+
{
75+
use Governable;
76+
// [...]
77+
```
78+
6979
### Configuration
7080
If you need to make any changes (see Example selection below for the default
7181
config file) to the default configuration, publish the configuration file:

0 commit comments

Comments
 (0)