<?php

namespace App\Repository;

use Carbon\Carbon;
use App\Categories;
use App\Packages;
class Navigation {

    CONST CACHE_KEY = 'Navigation';

    public function all() {
        
        $key = "all";
        $cacheKey = $this->getCacheKey($key);
        return cache()->remember($cacheKey, Carbon::now()->addMinutes(10), function() use($key) {
            
            $model= Categories::where("status", 1)->get();
            return $model;
        });
    }

    public function get($id) {
        
    }

    public function getCacheKey($key) {
        $key = strtoupper($key);

        return self::CACHE_KEY . $key;
    }

}
