<?php

namespace App\View\Composer;

use Illuminate\Support\Facades\Cache;
use Illuminate\View\View;

class ContestCategoryComposer
{
    public function compose(View $view)
    {
        $categories = Cache::rememberForever('contest_categories', function () {
            return \App\Models\ContestCategory::select('id', 'title', 'slug')->get();
        });
        $view->with('categories', $categories);
    }
}
