* create zapier app * install sanctum * move OAuthProviderController * make `api-external` middleware * add zapier endpoints * add tests * token management * zapier event handler * add policy * use `slug` instead of `id` * wip * check policies * change api prefix to `external` * ui tweaks * validate token abilities * open zapier URL * zapier ui tweaks * update zap * Fix linting * Added sample endpoints + minor UI changes * Run PHP code linter --------- Co-authored-by: Julien Nahum <julien@nahum.net>
32 lines
659 B
PHP
32 lines
659 B
PHP
<?php
|
|
|
|
namespace App\Http\Requests\Zapier;
|
|
|
|
use App\Models\Forms\Form;
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
use Illuminate\Validation\Rule;
|
|
|
|
class CreateIntegrationRequest extends FormRequest
|
|
{
|
|
public function rules()
|
|
{
|
|
return [
|
|
'form_id' => [
|
|
'required',
|
|
Rule::exists(Form::getModel()->getTable(), 'slug'),
|
|
],
|
|
'hookUrl' => [
|
|
'required',
|
|
'url',
|
|
],
|
|
];
|
|
}
|
|
|
|
public function form(): Form
|
|
{
|
|
return Form::query()
|
|
->where('slug', $this->input('form_id'))
|
|
->firstOrFail();
|
|
}
|
|
}
|