1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 13:12:50 +01:00

Create model observers

This commit is contained in:
David Bomba 2019-04-19 19:09:55 +10:00
parent 5282b6e77d
commit 89d42bcab8
53 changed files with 862 additions and 42 deletions

View File

@ -1,6 +1,6 @@
<?php
namespace App\Events;
namespace App\Events\Client;
use App\Models\Client;
use Illuminate\Queue\SerializesModels;

View File

@ -1,6 +1,6 @@
<?php
namespace App\Events;
namespace App\Events\Client;
use App\Models\Client;
use Illuminate\Queue\SerializesModels;

View File

@ -1,6 +1,6 @@
<?php
namespace App\Events;
namespace App\Events\Client;
use App\Models\Client;
use Illuminate\Queue\SerializesModels;

View File

@ -1,6 +1,6 @@
<?php
namespace App\Events;
namespace App\Events\Client;
use App\Models\Client;
use Illuminate\Queue\SerializesModels;

View File

@ -1,6 +1,6 @@
<?php
namespace App\Events;
namespace App\Events\Client;
use App\Models\Client;
use Illuminate\Queue\SerializesModels;

View File

@ -1,6 +1,6 @@
<?php
namespace App\Events;
namespace App\Events\Expense;
use App\Models\Expense;
use Illuminate\Queue\SerializesModels;

View File

@ -1,6 +1,6 @@
<?php
namespace App\Events;
namespace App\Events\Expense;
use App\Models\Expense;
use Illuminate\Queue\SerializesModels;

View File

@ -1,6 +1,6 @@
<?php
namespace App\Events;
namespace App\Events\Expense;
use App\Models\Expense;
use Illuminate\Queue\SerializesModels;

View File

@ -1,6 +1,6 @@
<?php
namespace App\Events;
namespace App\Events\Expense;
use App\Models\Expense;
use Illuminate\Queue\SerializesModels;

View File

@ -1,6 +1,6 @@
<?php
namespace App\Events;
namespace App\Events\Expense;
use App\Models\Expense;
use Illuminate\Queue\SerializesModels;

View File

@ -1,6 +1,6 @@
<?php
namespace App\Events;
namespace App\Events\Invoice;
use App\Models\Invoice;
use Illuminate\Queue\SerializesModels;

View File

@ -1,6 +1,6 @@
<?php
namespace App\Events;
namespace App\Events\Invoice;
use App\Models\Invoice;
use Illuminate\Queue\SerializesModels;

View File

@ -1,6 +1,6 @@
<?php
namespace App\Events;
namespace App\Events\Invoice;
use App\Models\Invoice;
use Illuminate\Queue\SerializesModels;

View File

@ -1,6 +1,6 @@
<?php
namespace App\Events;
namespace App\Events\Invoice;
use App\Models\Invoice;
use Illuminate\Queue\SerializesModels;

View File

@ -1,6 +1,6 @@
<?php
namespace App\Events;
namespace App\Events\Invoice;
use App\Models\Invoice;
use Illuminate\Queue\SerializesModels;

View File

@ -1,6 +1,6 @@
<?php
namespace App\Events;
namespace App\Events\Invoice;
use App\Models\Invoice;
use Illuminate\Queue\SerializesModels;

View File

@ -1,6 +1,6 @@
<?php
namespace App\Events;
namespace App\Events\Payment;
use App\Models\Payment;
use Illuminate\Queue\SerializesModels;

View File

@ -1,6 +1,6 @@
<?php
namespace App\Events;
namespace App\Events\Payment;
use App\Models\Payment;
use Illuminate\Queue\SerializesModels;

View File

@ -1,6 +1,6 @@
<?php
namespace App\Events;
namespace App\Events\Payment;
use App\Models\Payment;
use Illuminate\Queue\SerializesModels;

View File

@ -1,6 +1,6 @@
<?php
namespace App\Events;
namespace App\Events\Payment;
use App\Models\Payment;
use Illuminate\Queue\SerializesModels;

View File

@ -1,6 +1,6 @@
<?php
namespace App\Events;
namespace App\Events\Payment;
use App\Models\Payment;
use Illuminate\Queue\SerializesModels;

View File

@ -1,6 +1,6 @@
<?php
namespace App\Events;
namespace App\Events\Payment;
use App\Models\Payment;
use Illuminate\Queue\SerializesModels;

View File

@ -1,6 +1,6 @@
<?php
namespace App\Events;
namespace App\Events\Payment;
use App\Models\Payment;
use Illuminate\Queue\SerializesModels;

View File

@ -1,6 +1,6 @@
<?php
namespace App\Events;
namespace App\Events\Payment;
use App\Models\Payment;
use Illuminate\Queue\SerializesModels;

View File

@ -1,6 +1,6 @@
<?php
namespace App\Events;
namespace App\Events\Product;
use App\Models\Product;
use Illuminate\Queue\SerializesModels;

View File

@ -1,6 +1,6 @@
<?php
namespace App\Events;
namespace App\Events\Product;
use App\Models\Product;
use Illuminate\Queue\SerializesModels;

View File

@ -1,6 +1,6 @@
<?php
namespace App\Events;
namespace App\Events\Product;
use App\Models\Product;
use Illuminate\Queue\SerializesModels;

View File

@ -1,12 +1,13 @@
<?php
namespace App\Events;
namespace App\Events\Quote;
use Illuminate\Queue\SerializesModels;
class QuoteWasArchived extends Event
{
use SerializesModels;
public $quote;
/**

View File

@ -1,6 +1,6 @@
<?php
namespace App\Events;
namespace App\Events\Quote;
use Illuminate\Queue\SerializesModels;

View File

@ -1,6 +1,6 @@
<?php
namespace App\Events;
namespace App\Events\Quote;
use Illuminate\Queue\SerializesModels;

View File

@ -1,6 +1,6 @@
<?php
namespace App\Events;
namespace App\Events\Quote;
use Illuminate\Queue\SerializesModels;

View File

@ -1,6 +1,6 @@
<?php
namespace App\Events;
namespace App\Events\Quote;
use Illuminate\Queue\SerializesModels;

View File

@ -1,6 +1,6 @@
<?php
namespace App\Events;
namespace App\Events\Quote;
use Illuminate\Queue\SerializesModels;

View File

@ -1,6 +1,6 @@
<?php
namespace App\Events;
namespace App\Events\Task;
use App\Models\Task;
use Illuminate\Queue\SerializesModels;

View File

@ -1,6 +1,6 @@
<?php
namespace App\Events;
namespace App\Events\Task;
use App\Models\Task;
use Illuminate\Queue\SerializesModels;

View File

@ -1,6 +1,6 @@
<?php
namespace App\Events;
namespace App\Events\Task;
use App\Models\Task;
use Illuminate\Queue\SerializesModels;

View File

@ -1,6 +1,6 @@
<?php
namespace App\Events;
namespace App\Events\Task;
use App\Models\Task;
use Illuminate\Queue\SerializesModels;

View File

@ -1,6 +1,6 @@
<?php
namespace App\Events;
namespace App\Events\Task;
use App\Models\Task;
use Illuminate\Queue\SerializesModels;

View File

@ -11,10 +11,10 @@ use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
/**
* Class UserCreated
* Class UserWasCreated
* @package App\Events\User
*/
class UserCreated
class UserWasCreated
{
use Dispatchable, InteractsWithSockets, SerializesModels;

View File

@ -3,7 +3,7 @@
namespace App\Jobs\User;
use App\DataMapper\DefaultSettings;
use App\Events\User\UserCreated;
use App\Events\User\UserWasCreated;
use App\Models\CompanyUser;
use App\Models\User;
use App\Utils\Traits\MakesHash;
@ -64,7 +64,7 @@ class CreateUser
'settings' => json_encode(DefaultSettings::userSettings()),
]);
event(new UserCreated($user,$this->company));
event(new UserWasCreated($user,$this->company));
return $user;

View File

@ -0,0 +1,63 @@
<?php
namespace App\Observers;
use App\Models\Account;
class AccountObserver
{
/**
* Handle the account "created" event.
*
* @param \App\App\Models\Account $account
* @return void
*/
public function created(Account $account)
{
//
}
/**
* Handle the account "updated" event.
*
* @param \App\App\Models\Account $account
* @return void
*/
public function updated(Account $account)
{
//
}
/**
* Handle the account "deleted" event.
*
* @param \App\App\Models\Account $account
* @return void
*/
public function deleted(Account $account)
{
//
}
/**
* Handle the account "restored" event.
*
* @param \App\App\Models\Account $account
* @return void
*/
public function restored(Account $account)
{
//
}
/**
* Handle the account "force deleted" event.
*
* @param \App\App\Models\Account $account
* @return void
*/
public function forceDeleted(Account $account)
{
//
}
}

View File

@ -0,0 +1,63 @@
<?php
namespace App\Observers;
use App\Models\ClientContact;
class ClientContactObserver
{
/**
* Handle the client contact "created" event.
*
* @param \App\Models\ClientContact $clientContact
* @return void
*/
public function created(ClientContact $clientContact)
{
//
}
/**
* Handle the client contact "updated" event.
*
* @param \App\Models\ClientContact $clientContact
* @return void
*/
public function updated(ClientContact $clientContact)
{
//
}
/**
* Handle the client contact "deleted" event.
*
* @param \App\Models\ClientContact $clientContact
* @return void
*/
public function deleted(ClientContact $clientContact)
{
//
}
/**
* Handle the client contact "restored" event.
*
* @param \App\Models\ClientContact $clientContact
* @return void
*/
public function restored(ClientContact $clientContact)
{
//
}
/**
* Handle the client contact "force deleted" event.
*
* @param \App\Models\ClientContact $clientContact
* @return void
*/
public function forceDeleted(ClientContact $clientContact)
{
//
}
}

View File

@ -0,0 +1,63 @@
<?php
namespace App\Observers;
use App\Models\Client;
class ClientObserver
{
/**
* Handle the client "created" event.
*
* @param \App\Client $client
* @return void
*/
public function created(Client $client)
{
//
}
/**
* Handle the client "updated" event.
*
* @param \App\Client $client
* @return void
*/
public function updated(Client $client)
{
//
}
/**
* Handle the client "deleted" event.
*
* @param \App\Client $client
* @return void
*/
public function deleted(Client $client)
{
//
}
/**
* Handle the client "restored" event.
*
* @param \App\Client $client
* @return void
*/
public function restored(Client $client)
{
//
}
/**
* Handle the client "force deleted" event.
*
* @param \App\Client $client
* @return void
*/
public function forceDeleted(Client $client)
{
//
}
}

View File

@ -0,0 +1,63 @@
<?php
namespace App\Observers;
use App\Models\Company;
class CompanyObserver
{
/**
* Handle the company "created" event.
*
* @param \App\Models\Company $company
* @return void
*/
public function created(Company $company)
{
//
}
/**
* Handle the company "updated" event.
*
* @param \App\Models\Company $company
* @return void
*/
public function updated(Company $company)
{
//
}
/**
* Handle the company "deleted" event.
*
* @param \App\Models\Company $company
* @return void
*/
public function deleted(Company $company)
{
//
}
/**
* Handle the company "restored" event.
*
* @param \App\Models\Company $company
* @return void
*/
public function restored(Company $company)
{
//
}
/**
* Handle the company "force deleted" event.
*
* @param \App\Models\Company $company
* @return void
*/
public function forceDeleted(Company $company)
{
//
}
}

View File

@ -0,0 +1,63 @@
<?php
namespace App\Observers;
use App\Models\CompanyToken;
class CompanyTokenObserver
{
/**
* Handle the company token "created" event.
*
* @param \App\Models\CompanyToken $companyToken
* @return void
*/
public function created(CompanyToken $companyToken)
{
//
}
/**
* Handle the company token "updated" event.
*
* @param \App\Models\CompanyToken $companyToken
* @return void
*/
public function updated(CompanyToken $companyToken)
{
//
}
/**
* Handle the company token "deleted" event.
*
* @param \App\Models\CompanyToken $companyToken
* @return void
*/
public function deleted(CompanyToken $companyToken)
{
//
}
/**
* Handle the company token "restored" event.
*
* @param \App\Models\CompanyToken $companyToken
* @return void
*/
public function restored(CompanyToken $companyToken)
{
//
}
/**
* Handle the company token "force deleted" event.
*
* @param \App\Models\CompanyToken $companyToken
* @return void
*/
public function forceDeleted(CompanyToken $companyToken)
{
//
}
}

View File

@ -0,0 +1,63 @@
<?php
namespace App\Observers;
use App\Models\Expense;
class ExpenseObserver
{
/**
* Handle the expense "created" event.
*
* @param \App\Models\Expense $expense
* @return void
*/
public function created(Expense $expense)
{
//
}
/**
* Handle the expense "updated" event.
*
* @param \App\Models\Expense $expense
* @return void
*/
public function updated(Expense $expense)
{
//
}
/**
* Handle the expense "deleted" event.
*
* @param \App\Models\Expense $expense
* @return void
*/
public function deleted(Expense $expense)
{
//
}
/**
* Handle the expense "restored" event.
*
* @param \App\Models\Expense $expense
* @return void
*/
public function restored(Expense $expense)
{
//
}
/**
* Handle the expense "force deleted" event.
*
* @param \App\Models\Expense $expense
* @return void
*/
public function forceDeleted(Expense $expense)
{
//
}
}

View File

@ -0,0 +1,63 @@
<?php
namespace App\Observers;
use App\Models\Invoice;
class InvoiceObserver
{
/**
* Handle the client "created" event.
*
* @param \App\Models\Client $client
* @return void
*/
public function created(Invoice $invoice)
{
//
}
/**
* Handle the client "updated" event.
*
* @param \App\Models\Client $client
* @return void
*/
public function updated(Invoice $invoice)
{
//
}
/**
* Handle the client "deleted" event.
*
* @param \App\Models\Client $client
* @return void
*/
public function deleted(Invoice $invoice)
{
//
}
/**
* Handle the client "restored" event.
*
* @param \App\Models\Client $client
* @return void
*/
public function restored(Invoice $invoice)
{
//
}
/**
* Handle the client "force deleted" event.
*
* @param \App\Models\Client $client
* @return void
*/
public function forceDeleted(Invoice $invoice)
{
//
}
}

View File

@ -0,0 +1,63 @@
<?php
namespace App\Observers;
use App\Models\Payment;
class PaymentObserver
{
/**
* Handle the payment "created" event.
*
* @param \App\Models\Payment $payment
* @return void
*/
public function created(Payment $payment)
{
//
}
/**
* Handle the payment "updated" event.
*
* @param \App\Models\Payment $payment
* @return void
*/
public function updated(Payment $payment)
{
//
}
/**
* Handle the payment "deleted" event.
*
* @param \App\Models\Payment $payment
* @return void
*/
public function deleted(Payment $payment)
{
//
}
/**
* Handle the payment "restored" event.
*
* @param \App\Models\Payment $payment
* @return void
*/
public function restored(Payment $payment)
{
//
}
/**
* Handle the payment "force deleted" event.
*
* @param \App\Models\Payment $payment
* @return void
*/
public function forceDeleted(Payment $payment)
{
//
}
}

View File

@ -0,0 +1,63 @@
<?php
namespace App\Observers;
use App\Models\Product;
class ProductObserver
{
/**
* Handle the product "created" event.
*
* @param \App\Models\Product $product
* @return void
*/
public function created(Product $product)
{
//
}
/**
* Handle the product "updated" event.
*
* @param \App\Models\Product $product
* @return void
*/
public function updated(Product $product)
{
//
}
/**
* Handle the product "deleted" event.
*
* @param \App\Models\Product $product
* @return void
*/
public function deleted(Product $product)
{
//
}
/**
* Handle the product "restored" event.
*
* @param \App\Models\Product $product
* @return void
*/
public function restored(Product $product)
{
//
}
/**
* Handle the product "force deleted" event.
*
* @param \App\Models\Product $product
* @return void
*/
public function forceDeleted(Product $product)
{
//
}
}

View File

@ -0,0 +1,63 @@
<?php
namespace App\Observers;
use App\Models\Proposal;
class ProposalObserver
{
/**
* Handle the proposal "created" event.
*
* @param \App\Models\Proposal $proposal
* @return void
*/
public function created(Proposal $proposal)
{
//
}
/**
* Handle the proposal "updated" event.
*
* @param \App\Models\Proposal $proposal
* @return void
*/
public function updated(Proposal $proposal)
{
//
}
/**
* Handle the proposal "deleted" event.
*
* @param \App\Models\Proposal $proposal
* @return void
*/
public function deleted(Proposal $proposal)
{
//
}
/**
* Handle the proposal "restored" event.
*
* @param \App\Models\Proposal $proposal
* @return void
*/
public function restored(Proposal $proposal)
{
//
}
/**
* Handle the proposal "force deleted" event.
*
* @param \App\Models\Proposal $proposal
* @return void
*/
public function forceDeleted(Proposal $proposal)
{
//
}
}

View File

@ -0,0 +1,63 @@
<?php
namespace App\Observers;
use App\Models\Quote;
class QuoteObserver
{
/**
* Handle the quote "created" event.
*
* @param \App\Models\Quote $quote
* @return void
*/
public function created(Quote $quote)
{
//
}
/**
* Handle the quote "updated" event.
*
* @param \App\Models\Quote $quote
* @return void
*/
public function updated(Quote $quote)
{
//
}
/**
* Handle the quote "deleted" event.
*
* @param \App\Models\Quote $quote
* @return void
*/
public function deleted(Quote $quote)
{
//
}
/**
* Handle the quote "restored" event.
*
* @param \App\Models\Quote $quote
* @return void
*/
public function restored(Quote $quote)
{
//
}
/**
* Handle the quote "force deleted" event.
*
* @param \App\Models\Quote $quote
* @return void
*/
public function forceDeleted(Quote $quote)
{
//
}
}

View File

@ -0,0 +1,63 @@
<?php
namespace App\Observers;
use App\Models\Task;
class TaskObserver
{
/**
* Handle the task "created" event.
*
* @param \App\Models\Task $task
* @return void
*/
public function created(Task $task)
{
//
}
/**
* Handle the task "updated" event.
*
* @param \App\Models\Task $task
* @return void
*/
public function updated(Task $task)
{
//
}
/**
* Handle the task "deleted" event.
*
* @param \App\Models\Task $task
* @return void
*/
public function deleted(Task $task)
{
//
}
/**
* Handle the task "restored" event.
*
* @param \App\Models\Task $task
* @return void
*/
public function restored(Task $task)
{
//
}
/**
* Handle the task "force deleted" event.
*
* @param \App\Models\Task $task
* @return void
*/
public function forceDeleted(Task $task)
{
//
}
}

View File

@ -0,0 +1,63 @@
<?php
namespace App\Observers;
use App\Models\User;
class UserObserver
{
/**
* Handle the app models user "created" event.
*
* @param \App\Models\User $user
* @return void
*/
public function created(User $user)
{
//
}
/**
* Handle the app models user "updated" event.
*
* @param \App\Models\User $user
* @return void
*/
public function updated(User $user)
{
//
}
/**
* Handle the app models user "deleted" event.
*
* @param \App\Models\User $user
* @return void
*/
public function deleted(User $user)
{
//
}
/**
* Handle the app models user "restored" event.
*
* @param \App\Models\User $user
* @return void
*/
public function restored(User $user)
{
//
}
/**
* Handle the app models user "force deleted" event.
*
* @param \App\Models\User $user
* @return void
*/
public function forceDeleted(User $user)
{
//
}
}