diff --git a/app/Console/Commands/CreateAccount.php b/app/Console/Commands/CreateAccount.php index 90613083d2cb..c0eaed16bc59 100644 --- a/app/Console/Commands/CreateAccount.php +++ b/app/Console/Commands/CreateAccount.php @@ -131,9 +131,9 @@ class CreateAccount extends Command 'settings' => null, ]); - CreateCompanyPaymentTerms::dispatchSync($company, $user); - CreateCompanyTaskStatuses::dispatchSync($company, $user); - VersionCheck::dispatchSync(); + (new CreateCompanyPaymentTerms($company, $user))->handle(); + (new CreateCompanyTaskStatuses($company, $user))->handle(); + (new VersionCheck())->handle(); } private function warmCache() diff --git a/app/Console/Commands/DemoMode.php b/app/Console/Commands/DemoMode.php index 38fb577a1b38..8a5864a6440a 100644 --- a/app/Console/Commands/DemoMode.php +++ b/app/Console/Commands/DemoMode.php @@ -112,9 +112,9 @@ class DemoMode extends Command $this->info('Seeding Random Data'); $this->createSmallAccount(); - VersionCheck::dispatchSync(); + (new VersionCheck())->handle(); - CompanySizeCheck::dispatchSync(); + (new CompanySizeCheck())->handle(); } private function createSmallAccount() @@ -164,8 +164,8 @@ class DemoMode extends Command ]); } - CreateCompanyPaymentTerms::dispatchSync($company, $user); - CreateCompanyTaskStatuses::dispatchSync($company, $user); + (new CreateCompanyPaymentTerms($company, $user))->handle(); + (new CreateCompanyTaskStatuses($company, $user))->handle(); $company_token = new CompanyToken; $company_token->user_id = $user->id; diff --git a/app/Console/Commands/HostedUsers.php b/app/Console/Commands/HostedUsers.php index ec076dc86b26..63a1b94e7e35 100644 --- a/app/Console/Commands/HostedUsers.php +++ b/app/Console/Commands/HostedUsers.php @@ -43,13 +43,13 @@ class HostedUsers extends Command { Company::on('db-ninja-01')->each(function ($company) { if (Ninja::isHosted()) { - \Modules\Admin\Jobs\Account\NinjaUser::dispatchSync([], $company); + (new \Modules\Admin\Jobs\Account\NinjaUser([], $company))->handle(); } }); Company::on('db-ninja-02')->each(function ($company) { if (Ninja::isHosted()) { - \Modules\Admin\Jobs\Account\NinjaUser::dispatchSync([], $company); + (new \Modules\Admin\Jobs\Account\NinjaUser([], $company))->handle(); } }); } diff --git a/app/Console/Commands/SendTestEmails.php b/app/Console/Commands/SendTestEmails.php index 924fb7256608..aa10cd582234 100644 --- a/app/Console/Commands/SendTestEmails.php +++ b/app/Console/Commands/SendTestEmails.php @@ -96,6 +96,6 @@ class SendTestEmails extends Command $nmo->settings = $user->account->companies()->first()->settings; $nmo->to_user = $user; - NinjaMailerJob::dispatchSync($nmo); + (new NinjaMailerJob($nmo))->handle(); } } diff --git a/app/Jobs/Credit/ZipCredits.php b/app/Jobs/Credit/ZipCredits.php index ec851529a57b..0071338e0e6b 100644 --- a/app/Jobs/Credit/ZipCredits.php +++ b/app/Jobs/Credit/ZipCredits.php @@ -80,7 +80,7 @@ class ZipCredits implements ShouldQueue $path = $this->credits->first()->client->quote_filepath($invitation); $this->credits->each(function ($credit) { - CreateEntityPdf::dispatchSync($credit->invitations()->first()); + (new CreateEntityPdf($credit->invitations()->first()))->handle(); }); try { diff --git a/app/Mail/TemplateEmail.php b/app/Mail/TemplateEmail.php index 4ec31fd6ccdd..941cbc8a9637 100644 --- a/app/Mail/TemplateEmail.php +++ b/app/Mail/TemplateEmail.php @@ -142,7 +142,7 @@ class TemplateEmail extends Mailable sleep(2); if(!Storage::disk(config('filesystems.default'))->exists($path)) { - CreateEntityPdf::dispatchSync($this->invitation); + (new CreateEntityPdf($this->invitation))->handle(); sleep(2); } diff --git a/app/Models/InvoiceInvitation.php b/app/Models/InvoiceInvitation.php index 34da795f342b..c724f417ebc7 100644 --- a/app/Models/InvoiceInvitation.php +++ b/app/Models/InvoiceInvitation.php @@ -112,7 +112,7 @@ class InvoiceInvitation extends BaseModel if (! Storage::exists($this->invoice->client->invoice_filepath($this).$this->invoice->numberFormatter().'.pdf')) { event(new InvoiceWasUpdated($this->invoice, $this->company, Ninja::eventVars(auth()->user() ? auth()->user()->id : null))); - CreateEntityPdf::dispatchSync($this); + (new CreateEntityPdf($this))->handle(); } return $storage_path;