Fixes for observers

This commit is contained in:
David Bomba 2020-07-06 21:42:42 +10:00
parent 4c321d41c3
commit d236dd6ff6
8 changed files with 18 additions and 17 deletions

View File

@ -177,36 +177,44 @@ class DemoMode extends Command
$client = $company->clients->random();
$this->info('creating invoice for client #'.$client->id);
$this->createInvoice($client);
for($y=0; $y<($this->count); $y++){
$this->info("creating invoice #{$y} for client #".$client->id);
$this->createInvoice($client);
}
$client = $company->clients->random();
$this->info('creating credit for client #'.$client->id);
$this->createCredit($client);
for($y=0; $y<($this->count); $y++){
$this->info("creating credit #{$y} for client #".$client->id);
$this->createCredit($client);
}
$client = $company->clients->random();
$this->info('creating quote for client #'.$client->id);
$this->createQuote($client);
for($y=0; $y<($this->count); $y++){
$this->info("creating quote #{$y} for client #".$client->id);
$this->createQuote($client);
}
$client = $company->clients->random();
$this->info('creating expense for client #'.$client->id);
$this->info("creating expense for client #".$client->id);
$this->createExpense($client);
$client = $company->clients->random();
$this->info('creating vendor for client #'.$client->id);
$this->info("creating vendor for client #".$client->id);
$this->createVendor($client);
$client = $company->clients->random();
$this->info('creating task for client #'.$client->id);
$this->info("creating task for client #".$client->id);
$this->createTask($client);
$client = $company->clients->random();
$this->info('creating project for client #'.$client->id);
$this->info("creating project for client #".$client->id);
$this->createProject($client);
}

View File

@ -2,7 +2,6 @@
namespace App\Jobs\Util;
use App\Models\Subscription;
use App\Transformers\ArraySerializer;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
@ -45,7 +44,7 @@ class WebhookHandler implements ShouldQueue
//info("i got past the check");
$subscriptions = Webhook::where('company_id', $this->entity->company_id)
$subscriptions = \App\Models\Webhook::where('company_id', $this->entity->company_id)
->where('event_id', $this->event_id)
->get();

View File

@ -14,7 +14,6 @@ namespace App\Observers;
use App\Events\Client\ClientWasCreated;
use App\Jobs\Util\WebhookHandler;
use App\Models\Client;
use App\Models\Subscription;
use App\Models\Webhook;
class ClientObserver

View File

@ -13,7 +13,6 @@ namespace App\Observers;
use App\Jobs\Util\WebhookHandler;
use App\Models\Expense;
use App\Models\Subscription;
use App\Models\Webhook;
class ExpenseObserver

View File

@ -13,7 +13,6 @@ namespace App\Observers;
use App\Jobs\Util\WebhookHandler;
use App\Models\Invoice;
use App\Models\Subscription;
use App\Models\Webhook;
class InvoiceObserver

View File

@ -14,7 +14,6 @@ namespace App\Observers;
use App\Events\Payment\PaymentWasCreated;
use App\Jobs\Util\WebhookHandler;
use App\Models\Payment;
use App\Models\Subscription;
use App\Models\Webhook;
class PaymentObserver

View File

@ -13,7 +13,6 @@ namespace App\Observers;
use App\Jobs\Util\WebhookHandler;
use App\Models\Quote;
use App\Models\Subscription;
use App\Models\Webhook;
class QuoteObserver

View File

@ -12,7 +12,6 @@
namespace App\Observers;
use App\Jobs\Util\WebhookHandler;
use App\Models\Subscription;
use App\Models\Task;
use App\Models\Webhook;