packagist spatie/laravel-permission 2.26.0

latest releases: dev-main, 6.10.1, 6.10.0...
5 years ago
  • Substantial speed increase by caching the associations between models and permissions

NOTES:

The following changes are not "breaking", but worth making the updates to your app for consistency.

  1. Config file: The config/permission.php file changed to move cache-related settings into a sub-array. You should review the changes and merge the updates into your own config file. Specifically the expiration_time value has moved into a sub-array entry, and the old top-level entry is no longer used.
    See the master config file here:
    https://github.com/spatie/laravel-permission/blob/master/config/permission.php

  2. Cache Resets: If your app or tests are clearing the cache by specifying the cache key, it is better to use the built-in forgetCachedPermissions() method so that it properly handles tagged cache entries. Here is the recommended change:

- app()['cache']->forget('spatie.permission.cache');
+ $this->app->make(\Spatie\Permission\PermissionRegistrar::class)->forgetCachedPermissions();
  1. Also this is a good time to point out that now with v2.25.0 and v2.26.0 most permission-cache-reset scenarios may no longer be needed in your app, so it's worth reviewing those cases, as you may gain some app speed improvement by removing unnecessary cache resets.

Don't miss a new laravel-permission release

NewReleases is sending notifications on new releases.