From 289a26744b65d96ba845e4553e47e94f58ee25b2 Mon Sep 17 00:00:00 2001 From: Juha Vehnia Date: Mon, 2 Sep 2019 20:59:38 -0500 Subject: [PATCH] Improved documentation with Spatie\Permissions --- docs/hyn/5.4/cache.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/docs/hyn/5.4/cache.md b/docs/hyn/5.4/cache.md index 0357d7ed..a63dab49 100644 --- a/docs/hyn/5.4/cache.md +++ b/docs/hyn/5.4/cache.md @@ -51,3 +51,26 @@ allows you to set a custom cache driver in `config/cache.php`: > Make sure the CacheServiceProvider is registered in `config/app.php` or else your driver will not be available for use. + +If you are using Spatie\Permission package and receive error about driver `redis_tenancy` is not supported, +you need to turn off Laravel's package auto discovery for the package. This way you can set the load order and +ensure that Spatie permissions is loaded after redis_tenancy driver has been added. + +You can do this by adding don't discover to your composer.json file +``` +"extra": { + "laravel": + "dont-discover": [ + "spatie/laravel-permission" + ] + } +} +``` +Lastly make sure you load up the `PermissionServiceProvider` after your `AppServiceProvider` in `config/app.php` + +``` +App\Providers\AppServiceProvider::class, +... +Spatie\Permission\PermissionServiceProvider::class, +``` +