2024-08-12 11:14:02 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Http\Requests\Integration\Zapier;
|
|
|
|
|
|
|
|
|
|
use App\Models\Forms\Form;
|
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
|
use Illuminate\Validation\Rule;
|
|
|
|
|
|
|
|
|
|
class PollSubmissionRequest extends FormRequest
|
|
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* Get the validation rules that apply to the request.
|
|
|
|
|
*
|
|
|
|
|
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
|
|
|
|
|
*/
|
|
|
|
|
public function rules(): array
|
|
|
|
|
{
|
|
|
|
|
return [
|
|
|
|
|
'form_id' => [
|
|
|
|
|
'required',
|
2024-08-19 15:34:01 +02:00
|
|
|
Rule::exists(Form::getModel()->getTable(), 'id'),
|
2024-08-12 11:14:02 +02:00
|
|
|
],
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function form(): Form
|
|
|
|
|
{
|
2024-08-19 15:34:01 +02:00
|
|
|
return Form::findOrFail($this->input('form_id'));
|
2024-08-12 11:14:02 +02:00
|
|
|
}
|
|
|
|
|
}
|