* 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>
39 lines
1.4 KiB
PHP
39 lines
1.4 KiB
PHP
<?php
|
|
|
|
/**
|
|
* External API calls
|
|
*/
|
|
|
|
use App\Http\Controllers\Integrations\Zapier;
|
|
use App\Http\Controllers\Integrations\Zapier\ListFormsController;
|
|
use App\Http\Controllers\Integrations\Zapier\ListWorkspacesController;
|
|
|
|
Route::prefix('external')
|
|
->middleware('auth:sanctum')
|
|
->group(function () {
|
|
Route::prefix('zapier')->name('zapier.')->group(function () {
|
|
Route::get('validate', Zapier\ValidateAuthController::class)
|
|
->name('validate');
|
|
|
|
// Set and delete webhooks / manage integrations
|
|
Route::middleware('ability:manage-integrations')
|
|
->name('webhooks.')
|
|
->group(function () {
|
|
Route::post('webhook', [Zapier\IntegrationController::class, 'store'])
|
|
->name('store');
|
|
|
|
Route::delete('webhook', [Zapier\IntegrationController::class, 'destroy'])
|
|
->name('destroy');
|
|
Route::get('submissions/recent', [Zapier\IntegrationController::class, 'poll'])->name('poll');
|
|
});
|
|
|
|
Route::get('workspaces', ListWorkspacesController::class)
|
|
->middleware('ability:list-workspaces')
|
|
->name('workspaces');
|
|
|
|
Route::get('forms', ListFormsController::class)
|
|
->middleware('ability:list-forms')
|
|
->name('forms');
|
|
});
|
|
});
|