mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Subscription events
This commit is contained in:
parent
7e3a9205b9
commit
527d21bdc0
@ -40,7 +40,7 @@ class SubscriptionWasArchived
|
||||
*/
|
||||
public function __construct(Subscription $subscription, Company $company, array $event_vars)
|
||||
{
|
||||
$this->task = $subscription;
|
||||
$this->subscription = $subscription;
|
||||
$this->company = $company;
|
||||
$this->event_vars = $event_vars;
|
||||
}
|
||||
|
@ -40,7 +40,7 @@ class SubscriptionWasDeleted
|
||||
*/
|
||||
public function __construct(Subscription $subscription, Company $company, array $event_vars)
|
||||
{
|
||||
$this->task = $subscription;
|
||||
$this->subscription = $subscription;
|
||||
$this->company = $company;
|
||||
$this->event_vars = $event_vars;
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ class SubscriptionWasRestored
|
||||
*/
|
||||
public function __construct(Subscription $subscription, $fromDeleted, Company $company, array $event_vars)
|
||||
{
|
||||
$this->task = $subscription;
|
||||
$this->subscription = $subscription;
|
||||
$this->fromDeleted = $fromDeleted;
|
||||
$this->company = $company;
|
||||
$this->event_vars = $event_vars;
|
||||
|
@ -40,7 +40,7 @@ class SubscriptionWasUpdated
|
||||
*/
|
||||
public function __construct(Subscription $subscription, Company $company, array $event_vars)
|
||||
{
|
||||
$this->task = $subscription;
|
||||
$this->subscription = $subscription;
|
||||
$this->company = $company;
|
||||
$this->event_vars = $event_vars;
|
||||
}
|
||||
|
@ -85,7 +85,7 @@ class InvoiceController extends BaseController
|
||||
|
||||
$invoice = $invoice->service()->triggeredActions($request)->save();
|
||||
|
||||
event(new InvoiceWasCreated($invoice, $company, Ninja::eventVars(auth()->user()->id)));
|
||||
event(new InvoiceWasCreated($invoice, $company, Ninja::eventVars(auth()->user() ? auth()->user()->id : null)));
|
||||
|
||||
return $this->itemResponse($invoice);
|
||||
}
|
||||
|
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddSubscriptionIdToActivitiesTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('activities', function (Blueprint $table) {
|
||||
$table->unsignedInteger('subscription_id')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('activities', function (Blueprint $table) {
|
||||
//
|
||||
});
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user