1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-20 08:21:34 +02:00

Add rest method and headers to webhooks

This commit is contained in:
David Bomba 2021-04-06 07:41:51 +10:00
parent d9047b413a
commit 40335c0d92
3 changed files with 42 additions and 1 deletions

View File

@ -23,6 +23,8 @@ class WebhookFactory
$webhook->target_url = '';
$webhook->event_id = 1;
$webhook->format = 'JSON';
$webhook->rest_method = 'post';
$webhook->headers = [];
return $webhook;
}

View File

@ -57,6 +57,12 @@ class Webhook extends BaseModel
'target_url',
'format',
'event_id',
'rest_method',
'headers',
];
protected $casts = [
'headers' => 'array',
];
public function user()

View File

@ -0,0 +1,33 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddRestFieldsToWebhooksTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('webhooks', function (Blueprint $table) {
$table->text('rest_method')->nullable();
$table->text('headers')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('webhooks', function (Blueprint $table) {
//
});
}
}