feat: first commit

This commit is contained in:
2026-05-15 13:51:15 +02:00
commit 5ee10cb8b5
154 changed files with 22274 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class LoginRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
*/
public function rules(): array
{
return [
'email' => ['required', 'string'],
'password' => ['required', 'string'],
];
}
}
+27
View File
@@ -0,0 +1,27 @@
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class MealPostsRequest extends FormRequest
{
public function rules(): array
{
return [
'image_url' => ['required', 'string', 'url', 'max:255'],
'caption' => ['nullable', 'string', 'max:1000'],
'calories' => ['nullable', 'integer', 'min:0'],
'proteins' => ['nullable', 'numeric', 'min:0'],
'carbs' => ['nullable', 'numeric', 'min:0'],
'fats' => ['nullable', 'numeric', 'min:0'],
'title' => ['required', 'string', 'max:255'],
'eaten_at' => ['required', 'date'],
];
}
public function authorize(): bool
{
return true;
}
}
+41
View File
@@ -0,0 +1,41 @@
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class RegisterRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
*/
public function rules(): array
{
return [
'name' => ['required', 'string', 'max:255'],
'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
'password' => ['required', 'string', 'min:8'],
'avatar' => ['sometimes', 'nullable', 'image', 'max:2048'],
'bio' => [ 'nullable', 'string']
];
}
public function messages(): array
{
return [
'avatar.max' => "L'image ne doit pas dépasser 2 Mo.",
];
}
}
+27
View File
@@ -0,0 +1,27 @@
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class UpdateUserRequest extends FormRequest
{
public function authorize(): bool
{
return true;
}
public function rules(): array
{
return [
'avatar' => ['sometimes', 'nullable', 'image', 'max:2048'],
];
}
public function messages(): array
{
return [
'avatar.max' => "L'image ne doit pas dépasser 2 Mo.",
];
}
}