- Add testimonials table migration with personality enum - Create Testimonial model with HasTranslations trait - Add TestimonialSeeder with 4 test testimonials - Create TestimonialController and TestimonialResource - Add useFetchTestimonials composable - Create TestimonialCard component with personality-based styling - Add temoignages.vue page with loading/error states - Add testimonials translations in FR/EN Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
22 lines
499 B
PHP
22 lines
499 B
PHP
<?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()]]);
|
|
}
|
|
}
|