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
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\Feed;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
|
||||
class FeedController extends Controller
|
||||
{
|
||||
public function index(): JsonResponse
|
||||
{
|
||||
$feeds = Feed::publie()
|
||||
->orderBy('ordre')
|
||||
->orderBy('created_at', 'desc')
|
||||
->get(['id', 'titre', 'slug', 'contenu', 'image_url', 'ordre', 'created_at']);
|
||||
|
||||
return response()->json($feeds);
|
||||
}
|
||||
|
||||
public function show(string $slug): JsonResponse
|
||||
{
|
||||
$feed = Feed::publie()->where('slug', $slug)->with('auteur:id,nom,prenom')->firstOrFail();
|
||||
|
||||
return response()->json($feed);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user