38 lines
1.0 KiB
PHP
38 lines
1.0 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Requests\V3\AccidentReceipt;
|
|
|
|
use App\Enums\AccidentStates;
|
|
use Illuminate\Contracts\Validation\ValidationRule;
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
class ConfirmPaymentInfoRequest extends FormRequest
|
|
{
|
|
/**
|
|
* Determine if the user is authorized to make this request.
|
|
*/
|
|
public function authorize(): bool
|
|
{
|
|
return in_array($this->accident->status,
|
|
[
|
|
AccidentStates::SODOR_NAME_BIME_VA_DAGHI->value,
|
|
AccidentStates::SABT_FISH->value
|
|
]);
|
|
}
|
|
|
|
/**
|
|
* Get the validation rules that apply to the request.
|
|
*
|
|
* @return array<string, ValidationRule|array|string>
|
|
*/
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'deposit_insurance_image' => 'file',
|
|
'deposit_insurance_amount' => 'required_with:deposit_insurance_image',
|
|
'deposit_daghi_image' => 'file',
|
|
'deposit_daghi_amount' => 'required_with:deposit_daghi_image',
|
|
];
|
|
}
|
|
}
|