PHP code example of anorgan / laravel-cache

1. Go to this page and download the library: Download anorgan/laravel-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/ */

    

anorgan / laravel-cache example snippets


// config/app.php
'providers' => [
    ...
    Anorgan\LaravelCache\LaravelCacheServiceProvider::class
];



return [
    /*
     * Add keys per model which should be invalidated alongside default model key and tags,
     * e.g. for Product::class, you would like to invalidate cache with key "product_listing"
     */
    'invalidate' => [
        \App\Product::class => [
            'product_listing'
        ]
    ],
];

bash
php artisan vendor:publish --provider="Anorgan\LaravelCache\LaravelCacheServiceProvider" --tag="config"