<?php

namespace App\Livewire;

use App\Models\ServiceCategory;
use Illuminate\Support\Facades\Cache;
use Livewire\Attributes\Computed;
use Livewire\Attributes\Title;
use Livewire\Attributes\Layout;
use Livewire\Component;
use Livewire\WithPagination;

#[Title('Our Services')]
#[Layout('components.layouts.app')]
class Services extends Component
{

    #[Computed]
    public function categories()
    {
        return ServiceCategory::active()
            ->ordered()
            ->get();
    }

     #[Computed]
    public function page()
    {
        return \App\Models\Page::where('id',5)
            ->where('is_published', true)
            ->first();
    }

    #[Computed]
    public function clients()
    {
        return \App\Models\Client::active()
            ->select(['id', 'name', 'logo'])
            ->get();
    }

    public function render()
    {
        return view('livewire.services');
    }
}
