mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 13:12:50 +01:00
Add rest method and headers to webhooks
This commit is contained in:
parent
d9047b413a
commit
40335c0d92
@ -23,6 +23,8 @@ class WebhookFactory
|
||||
$webhook->target_url = '';
|
||||
$webhook->event_id = 1;
|
||||
$webhook->format = 'JSON';
|
||||
$webhook->rest_method = 'post';
|
||||
$webhook->headers = [];
|
||||
|
||||
return $webhook;
|
||||
}
|
||||
|
@ -57,6 +57,12 @@ class Webhook extends BaseModel
|
||||
'target_url',
|
||||
'format',
|
||||
'event_id',
|
||||
'rest_method',
|
||||
'headers',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'headers' => 'array',
|
||||
];
|
||||
|
||||
public function user()
|
||||
|
@ -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) {
|
||||
//
|
||||
});
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user