feat: L'Ami Fiduciaire V1.0.0 — full codebase with Story 0.1 complete
Initial commit of the L'Ami Fiduciaire SaaS platform built on Laravel 12, Vue 3, Inertia.js 2, and Tailwind CSS 4. Story 0.1 (rename folders to declarations in database) is implemented and code-reviewed: migration, rollback, and 6 Pest tests all passing. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
54
app/Http/Requests/StoreFolderMessageRequest.php
Normal file
54
app/Http/Requests/StoreFolderMessageRequest.php
Normal file
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use App\Enums\MessageType;
|
||||
use BenSampo\Enum\Rules\EnumValue;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class StoreFolderMessageRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return $this->user() !== null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
$rules = [
|
||||
'type' => ['required', new EnumValue(MessageType::class)],
|
||||
'body' => ['required', 'string', 'max:65535'],
|
||||
'files' => ['nullable', 'array'],
|
||||
'files.*' => ['file', 'max:10240'], // 10MB per file
|
||||
];
|
||||
|
||||
$type = $this->input('type');
|
||||
|
||||
if (in_array($type, ['situation', 'confirmation'])) {
|
||||
$rules['files'] = ['required', 'array', 'min:1'];
|
||||
}
|
||||
|
||||
return $rules;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get custom attributes for validator errors.
|
||||
*
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public function attributes(): array
|
||||
{
|
||||
return [
|
||||
'body' => 'message',
|
||||
'files' => 'fichiers',
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user