Skip to content

Commit

Permalink
[Docs] Simplify instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
drbyte authored Aug 21, 2023
1 parent 04b3230 commit 8eb76af
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions docs/installation-laravel.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,28 +43,30 @@ Package Version | Laravel Version
php artisan vendor:publish --provider="Spatie\Permission\PermissionServiceProvider"
```

6. NOTE: **If you are using UUIDs**, see the Advanced section of the docs on UUID steps, before you continue. It explains some changes you may want to make to the migrations and config file before continuing. It also mentions important considerations after extending this package's models for UUID capability.
6. BEFORE RUNNING MIGRATIONS

**If you are going to use the TEAMS features**, you must update your [`config/permission.php` config file](https://github.com/spatie/laravel-permission/blob/main/config/permission.php) and set `'teams' => true,`; and in your database if you want to use a custom foreign key for teams you must change `team_foreign_key`.
- **If you are using UUIDs**, see the Advanced section of the docs on UUID steps, before you continue. It explains some changes you may want to make to the migrations and config file before continuing. It also mentions important considerations after extending this package's models for UUID capability.

7. NOTE: If you are using MySQL 8, look at the migration files for notes about MySQL 8 to set/limit the index key length, and edit accordingly.
- **If you are going to use the TEAMS features**, you must update your [`config/permission.php` config file](https://github.com/spatie/laravel-permission/blob/main/config/permission.php) and set `'teams' => true,`; and in your database if you want to use a custom foreign key for teams you must change `team_foreign_key`.

8. **Clear your config cache**. This package requires access to the `permission` config. Generally it's bad practice to do config-caching in a development environment. If you've been caching configurations locally, clear your config cache with either of these commands:
- **If you are using MySQL 8**, look at the migration files for notes about MySQL 8 to set/limit the index key length, and edit accordingly.

7. **Clear your config cache**. This package requires access to the `permission` config settings in order to run migrations. If you've been caching configurations locally, clear your config cache with either of these commands:

php artisan optimize:clear
# or
php artisan config:clear

9. **Run the migrations**: After the config and migration have been published and configured, you can create the tables for this package by running:
8. **Run the migrations**: After the config and migration have been published and configured, you can create the tables for this package by running:

php artisan migrate

10. **Add the necessary trait to your User model**:
9. **Add the necessary trait to your User model**:

// The User model requires this trait
use HasRoles;

Consult the **Basic Usage** section of the docs to get started using the features of this package.
10. Consult the **Basic Usage** section of the docs to get started using the features of this package.

.

Expand Down

0 comments on commit 8eb76af

Please sign in to comment.