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,34 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class StoreSaisieRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'emotion_id' => 'required|exists:emotions,id',
|
||||
'intensite' => 'required|integer|between:1,10',
|
||||
'note' => 'nullable|string|max:2000',
|
||||
'date_saisie' => 'required|date',
|
||||
];
|
||||
}
|
||||
|
||||
public function messages(): array
|
||||
{
|
||||
return [
|
||||
'emotion_id.required' => 'L\'émotion est obligatoire.',
|
||||
'emotion_id.exists' => 'Cette émotion n\'existe pas.',
|
||||
'intensite.required' => 'L\'intensité est obligatoire.',
|
||||
'intensite.between' => 'L\'intensité doit être entre 1 et 10.',
|
||||
'date_saisie.required' => 'La date est obligatoire.',
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user