PHP code example of aldeebhasan / laravel-cache-flusher
1. Go to this page and download the library: Download aldeebhasan/laravel-cache-flusher 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/ */
aldeebhasan / laravel-cache-flusher example snippets
// define the binding mapping function
class AppServiceProvider extends ServiceProvider
{
public function boot()
{
//.... other boot methods
CacheFlusher::setBindingFunction(
function (string $bindingKey, Model $model): ?string {
switch ($bindingKey) {
case "company_id":
return '1'; //$model->company_id
case "user_id":
return "2"; // $model->user_id;
}
return null;
});
}
}