34 lines
955 B
PHP
34 lines
955 B
PHP
<?php
|
|
|
|
namespace App\Http\Requests\V3\AccidentReceipt;
|
|
|
|
use App\Enums\AccidentStates;
|
|
use App\Models\Accident;
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
class ConfirmPaymentInfoRequest extends FormRequest
|
|
{
|
|
/**
|
|
* Determine if the user is authorized to make this request.
|
|
*/
|
|
public function authorize(Accident $accident): bool
|
|
{
|
|
return $accident->status === AccidentStates::SODOR_NAME_BIME_VA_DAGHI->value;
|
|
}
|
|
|
|
/**
|
|
* Get the validation rules that apply to the request.
|
|
*
|
|
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|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',
|
|
];
|
|
}
|
|
}
|