Files
cesizen-individuel/backend/app/Http/Controllers/EmotionController.php
T
Azmog e3da625927 feat: initialisation complète du projet CESIZen
- Backend Laravel 11 (API REST, JWT auth, PostgreSQL)
- Frontend Next.js 14 (React, TypeScript, Tailwind CSS)
- Docker Compose (PostgreSQL, backend, frontend)
- Modules : auth, profil, tracker émotions, informations, admin
2026-03-11 16:27:01 +01:00

23 lines
478 B
PHP

<?php
namespace App\Http\Controllers;
use App\Models\Emotion;
use Illuminate\Http\JsonResponse;
class EmotionController extends Controller
{
public function index(): JsonResponse
{
$emotions = Emotion::actives()
->niveau(1)
->with(['enfants' => function ($query) {
$query->actives()->orderBy('nom');
}])
->orderBy('nom')
->get();
return response()->json($emotions);
}
}