| 123456789101112131415161718192021222324252627 |
- <?php
- namespace App\Http\Requests;
- use Illuminate\Foundation\Http\FormRequest;
- use Illuminate\Validation\Rule;
- class StoreFranchisorReceivableRequest extends FormRequest
- {
- public function rules(): array
- {
- return [
- 'account_type' => ['required', Rule::in(['internal', 'unit'])],
- 'unit_id' => [
- Rule::requiredIf($this->input('account_type') === 'unit'),
- 'nullable',
- 'integer',
- 'exists:units,id',
- ],
- 'history' => ['required', 'string', 'max:255'],
- 'value' => ['required', 'numeric', 'min:0.01'],
- 'due_date' => ['required', 'date'],
- 'financial_plan_account_id' => ['nullable', 'integer', 'exists:financial_plan_accounts,id'],
- 'obs' => ['nullable', 'string', 'max:1000'],
- ];
- }
- }
|