Changes 0228092025 Laptop

This commit is contained in:
2025-09-28 14:51:02 +02:00
parent 765beb78b7
commit b40ee9dcde
36 changed files with 2099 additions and 65 deletions
@@ -0,0 +1,37 @@
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;
class StoreContractRequest extends FormRequest
{
public function authorize(): bool
{
return true;
}
public function rules(): array
{
$clientCase = $this->route('client_case');
return [
'reference' => [
'nullable',
'string',
'max:125',
Rule::unique('contracts', 'reference')
->where(fn ($q) => $q
->where('client_case_id', optional($clientCase)->id)
->whereNull('deleted_at')
),
],
'start_date' => ['required', 'date'],
'type_id' => ['required', 'integer', 'exists:contract_types,id'],
'description' => ['nullable', 'string', 'max:255'],
'initial_amount' => ['nullable', 'numeric'],
'balance_amount' => ['nullable', 'numeric'],
];
}
}