Skip to content

Commit bc7578e

Browse files
committed
Specify expiration in cache timeouts as dateTime for Laravel 5.8
1 parent 05bf5c3 commit bc7578e

3 files changed

Lines changed: 8 additions & 8 deletions

File tree

src/Controllers/TicketsController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -614,13 +614,13 @@ protected function getCacheList($list)
614614

615615
switch ($list){
616616
case 'priorities':
617-
$instance = Cache::remember('panichd::priorities', 60, function () {
617+
$instance = Cache::remember('panichd::priorities', \Carbon\Carbon::now()->addMinutes(60), function () {
618618
return Models\Priority::orderBy('magnitude', 'desc')->get();
619619
});
620620
break;
621621
case 'statuses':
622622
case 'complete_statuses':
623-
$instance = Cache::remember('panichd::' . $list, 60, function () use($list) {
623+
$instance = Cache::remember('panichd::' . $list, \Carbon\Carbon::now()->addMinutes(60), function () use($list) {
624624
if (!Setting::grab('use_default_status_id') or $list == 'complete_statuses'){
625625
return Models\Status::all()->where('id', '!=', Setting::grab('default_status_id'));
626626
}else

src/Models/Setting.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ public static function grab($slug)
4848
*/
4949
// Cache::flush();
5050

51-
$setting = Cache::remember('panichd::settings.'.$slug, 60, function () use ($slug) {
52-
$settings = Cache::remember('panichd::settings', 60, function () {
51+
$setting = Cache::remember('panichd::settings.'.$slug, \Carbon\Carbon::now()->addMinutes(60), function () use ($slug) {
52+
$settings = Cache::remember('panichd::settings', \Carbon\Carbon::now()->addMinutes(60), function () {
5353
return Table::all();
5454
});
5555

src/Traits/CacheVars.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,20 @@ trait CacheVars
1414
*/
1515
protected function getFirstTicketCompleteYear()
1616
{
17-
return Cache::remember('panichd::first_ticket_complete_year', 60, function(){
17+
return Cache::remember('panichd::first_ticket_complete_year', \Carbon\Carbon::now()->addMinutes(60), function(){
1818
$ticket = Ticket::complete()->orderBy('completed_at', 'asc')->first();
1919
return $ticket ? $ticket->completed_at->year : date('Y');
2020
});
2121
}
22-
22+
2323
/**
2424
* Get array with complete tickets count by creation_at year
2525
*
2626
* @Return array
2727
*/
2828
protected function getCompleteTicketYearCounts()
2929
{
30-
return Cache::remember('panichd::a_complete_ticket_year_counts', 60, function(){
30+
return Cache::remember('panichd::a_complete_ticket_year_counts', \Carbon\Carbon::now()->addMinutes(60), function(){
3131
$a_years = range($this->getFirstTicketCompleteYear(), date('Y'));
3232
rsort($a_years);
3333
$a_year_counts = [];
@@ -37,4 +37,4 @@ protected function getCompleteTicketYearCounts()
3737
return $a_year_counts;
3838
});
3939
}
40-
}?>
40+
}?>

0 commit comments

Comments
 (0)