0

I used put function for make new manual Cashe. for example :

$cashtime =Cache::put('filekey', 'mycashtime', 20);

and sent it to view but it not expired . when i send it to view it will back me true. but after 20s have to send me false and expire it.

and then how can i check it is expired or not .

Neda Zare
  • 1
  • 2

1 Answers1

0

I solved it.my problem was first I have to check if key doesnt exist set again else do someting.

       view()->composer('admin.sidebar', function($view){
            $cashtime = Cache::get('filekeys');
            if($cashtime == Null){
                    Cache::put('filekeys', 'mycashtimes', now()->addMinutes(1));
                    //do something
            }else{
                //do something
            }
            
            $view->with(['testmneda' => $cashtime]);
        });
Neda Zare
  • 1
  • 2