<?php

namespace App\Http\Controllers\Api;

use App\Http\Controllers\Controller;
use App\Http\Resources\TestimonialResource;
use App\Models\Testimonial;

class TestimonialController extends Controller
{
    public function index()
    {
        $testimonials = Testimonial::with('project')
            ->active()
            ->ordered()
            ->get();

        return TestimonialResource::collection($testimonials)
            ->additional(['meta' => ['lang' => app()->getLocale()]]);
    }
}
