mirror of
https://github.com/fergalmoran/OpnForm.git
synced 2026-01-26 02:14:46 +00:00
Initial commit
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Integration;
|
||||
|
||||
use App\Models\Forms\Form;
|
||||
use App\Models\Integration\FormZapierWebhook;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class StoreFormZapierWebhookRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'form_slug' => 'required|exists:forms,slug',
|
||||
'hook_url' => 'required|string|url'
|
||||
];
|
||||
}
|
||||
|
||||
public function instanciateHook() {
|
||||
$form = Form::whereSlug($this->form_slug)->firstOrFail();
|
||||
return new FormZapierWebhook([
|
||||
'form_id' => $form->id,
|
||||
'hook_url' => $this->hook_url,
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user