PHP code example of yaroslavpopovic / laravel-policy-soft-cache

1. Go to this page and download the library: Download yaroslavpopovic/laravel-policy-soft-cache library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

yaroslavpopovic / laravel-policy-soft-cache example snippets


return [
    /*
     * When enabled, the package will cache the results of all Policies in your Laravel application
     */
    'cache_all_policies' => env('CACHE_ALL_POLICIES', true),
];

use Innoge\LaravelPolicySoftCache\Contracts\SoftCacheable;

class UserPolicy implements SoftCacheable
{
    // ...
}

\Innoge\LaravelPolicySoftCache\LaravelPolicySoftCache::flushCache();
bash
php artisan vendor:publish --provider="Innoge\LaravelPolicySoftCache\LaravelPolicySoftCacheServiceProvider"