I am trying to store the last run time of a scheduled job in Laravel. However, the cache is not updating the date. I want the cache to be remembered until the function is called again.
public function setLastRun() {
Cache::forget('last_automation_api_run');
Cache::rememberForever('last_automation_api_run', function () {
return now()->toDateTimeString();
});
}