fix: update HistoricalMilestone.php->getPublishedOrdered method
This commit is contained in:
parent
1d9b2cda8d
commit
bb56107eab
1 changed files with 6 additions and 6 deletions
|
|
@ -119,19 +119,19 @@ class HistoricalMilestone extends Model
|
|||
*/
|
||||
private static function resetCache()
|
||||
{
|
||||
Cache::forget('publishedHistoricalMilestonesOrderedByYear');
|
||||
self::getPublishedOrderedByYear();
|
||||
Cache::forget('publishedHistoricalMilestonesOrdered');
|
||||
self::getPublishedOrdered();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all published HistoricalMilestones ordered by year.
|
||||
* Get all published HistoricalMilestones ordered.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Collection
|
||||
*/
|
||||
public static function getPublishedOrderedByYear(): \Illuminate\Database\Eloquent\Collection
|
||||
public static function getPublishedOrdered(): \Illuminate\Database\Eloquent\Collection
|
||||
{
|
||||
return Cache::rememberForever('publishedHistoricalMilestonesOrderedByYear', function () {
|
||||
return self::query()->where('published', true)->orderBy('year')->get();
|
||||
return Cache::rememberForever('publishedHistoricalMilestonesOrdered', function () {
|
||||
return self::query()->where('published', true)->orderBy('order')->get();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue