<?php

namespace App\View\Composer;

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

class LanguageComposer
{
    public function compose(View $view)
    {
        $languages = Cache::rememberForever('language_list', function () {
            return \App\Models\Language::active()->select('id', 'name', 'code')->get();
        });
        $view->with('languages', $languages);
    }
}
