<?php

namespace App\Livewire;

use Livewire\Component;
use App\Models\Work;
use App\Models\Blog;

class Home extends Component
{
    public function render()
    {
        // WORK SECTION (as it is)
       $works = Work::where('status', 1)
            ->orderBy('position')
            ->limit(12)
            ->get();


        // NEWS / BLOG SECTION (sirf 3 latest)
        $blogs = Blog::where('status', 1)
            ->latest('publish_date')
            ->take(3)
            ->get();

        return view('livewire.home', compact('works', 'blogs'))
            ->layout('components.layout');
    }
}
