diff --git a/app/Console/Commands/CheckData.php b/app/Console/Commands/CheckData.php index 42cc3f86ee05..469f98a4a87e 100644 --- a/app/Console/Commands/CheckData.php +++ b/app/Console/Commands/CheckData.php @@ -415,8 +415,8 @@ class CheckData extends Command $invitation->company_id = $invoice->company_id; $invitation->user_id = $invoice->user_id; $invitation->invoice_id = $invoice->id; - $invitation->contact_id = ClientContact::whereClientId($invoice->client_id)->first()->id; - $invitation->invitation_key = Str::random(config('ninja.key_length')); + $invitation->client_contact_id = ClientContact::whereClientId($invoice->client_id)->first()->id; + $invitation->key = Str::random(config('ninja.key_length')); $invitation->save(); } } @@ -447,7 +447,7 @@ class CheckData extends Command $contact_id = 'client_contact_id'; $contact_class = ClientContact::class; - $entity_key = \Illuminate\Support\Str::of(class_basename($entity))->snake()->append('_id')->value; + $entity_key = \Illuminate\Support\Str::of(class_basename($entity))->snake()->append('_id')->toString(); $entity_obj = get_class($entity).'Invitation'; if ($entity instanceof PurchaseOrder) { diff --git a/app/Console/Commands/CreateAccount.php b/app/Console/Commands/CreateAccount.php index e4e5b31e3dca..4bfa4c7a1326 100644 --- a/app/Console/Commands/CreateAccount.php +++ b/app/Console/Commands/CreateAccount.php @@ -42,11 +42,6 @@ class CreateAccount extends Command */ protected $signature = 'ninja:create-account {--email=} {--password=}'; - /** - * Create a new command instance. - * - * @param InvoiceRepository $invoice_repo - */ public function __construct() { parent::__construct(); diff --git a/app/Console/Commands/DesignUpdate.php b/app/Console/Commands/DesignUpdate.php index c924ea268dfc..4ff2f685678c 100644 --- a/app/Console/Commands/DesignUpdate.php +++ b/app/Console/Commands/DesignUpdate.php @@ -60,7 +60,7 @@ class DesignUpdate extends Command foreach (MultiDB::$dbs as $db) { MultiDB::setDB($db); - $this->handleOnDb($db); + $this->handleOnDb(); } MultiDB::setDB($current_db); diff --git a/app/Console/Commands/HostedMigrations.php b/app/Console/Commands/HostedMigrations.php index d2a3b4bcc1b8..7bcb5c8aba0b 100644 --- a/app/Console/Commands/HostedMigrations.php +++ b/app/Console/Commands/HostedMigrations.php @@ -105,7 +105,7 @@ class HostedMigrations extends Command Import::dispatch($import_file, $user->companies()->first(), $user); } catch (NonExistingMigrationFile | ProcessingMigrationArchiveFailed | ResourceNotAvailableForMigration | MigrationValidatorFailed | ResourceDependencyMissing $e) { - \Mail::to($this->user)->send(new MigrationFailed($e, $e->getMessage())); + \Mail::to($user)->send(new MigrationFailed($e, $company)); if (app()->environment() !== 'production') { info($e->getMessage()); diff --git a/app/Console/Commands/HostedUsers.php b/app/Console/Commands/HostedUsers.php index 133198b3e4cd..74341544ec5e 100644 --- a/app/Console/Commands/HostedUsers.php +++ b/app/Console/Commands/HostedUsers.php @@ -44,7 +44,6 @@ class HostedUsers extends Command /** * Execute the console command. * - * @return int */ public function handle() { diff --git a/app/Console/Commands/ImportMigrations.php b/app/Console/Commands/ImportMigrations.php index 2d0483861618..7e741c4bea54 100644 --- a/app/Console/Commands/ImportMigrations.php +++ b/app/Console/Commands/ImportMigrations.php @@ -107,7 +107,7 @@ class ImportMigrations extends Command Import::dispatch($import_file, $this->getUser()->companies()->first(), $this->getUser()); // StartMigration::dispatch($file->getRealPath(), $this->getUser(), $this->getUser()->companies()->first()); } catch (NonExistingMigrationFile | ProcessingMigrationArchiveFailed | ResourceNotAvailableForMigration | MigrationValidatorFailed | ResourceDependencyMissing $e) { - \Mail::to($this->user)->send(new MigrationFailed($e, $e->getMessage())); + \Mail::to($user)->send(new MigrationFailed($e, $company)); if (app()->environment() !== 'production') { info($e->getMessage()); diff --git a/app/Console/Commands/OpenApiYaml.php b/app/Console/Commands/OpenApiYaml.php index 204f06b9abad..530e0da1b7e0 100644 --- a/app/Console/Commands/OpenApiYaml.php +++ b/app/Console/Commands/OpenApiYaml.php @@ -12,7 +12,6 @@ namespace App\Console\Commands; use DirectoryIterator; -use Faker\Factory; use Illuminate\Console\Command; use Illuminate\Support\Facades\Storage; @@ -44,8 +43,6 @@ class OpenApiYaml extends Command */ public function __construct() { - $this->faker = Factory::create(); - parent::__construct(); } diff --git a/app/Console/Commands/S3Cleanup.php b/app/Console/Commands/S3Cleanup.php index f5beffe52977..0397040120de 100644 --- a/app/Console/Commands/S3Cleanup.php +++ b/app/Console/Commands/S3Cleanup.php @@ -47,7 +47,6 @@ class S3Cleanup extends Command /** * Execute the console command. * - * @return int */ public function handle() { diff --git a/app/Console/Commands/SendRemindersCron.php b/app/Console/Commands/SendRemindersCron.php index 7921633c8d9d..b7f44231fa75 100644 --- a/app/Console/Commands/SendRemindersCron.php +++ b/app/Console/Commands/SendRemindersCron.php @@ -57,7 +57,6 @@ class SendRemindersCron extends Command /** * Execute the console command. * - * @return int */ public function handle() { diff --git a/app/DataMapper/Analytics/AccountCreated.php b/app/DataMapper/Analytics/AccountCreated.php index 3400cd856406..9f3b5c5d6e82 100644 --- a/app/DataMapper/Analytics/AccountCreated.php +++ b/app/DataMapper/Analytics/AccountCreated.php @@ -37,7 +37,7 @@ class AccountCreated extends GenericCounter * * date("Y-m-d H:i:s") * - * @var DateTime + * @var \DateTime */ public $datetime; diff --git a/app/DataMapper/Analytics/AccountDeleted.php b/app/DataMapper/Analytics/AccountDeleted.php index 40973c93e905..fba503ed543b 100644 --- a/app/DataMapper/Analytics/AccountDeleted.php +++ b/app/DataMapper/Analytics/AccountDeleted.php @@ -37,7 +37,7 @@ class AccountDeleted extends GenericCounter * * date("Y-m-d H:i:s") * - * @var DateTime + * @var \DateTime */ public $datetime; diff --git a/app/DataMapper/Analytics/AccountPlatform.php b/app/DataMapper/Analytics/AccountPlatform.php index a1c3027f7fe8..db3e785767d3 100644 --- a/app/DataMapper/Analytics/AccountPlatform.php +++ b/app/DataMapper/Analytics/AccountPlatform.php @@ -37,7 +37,7 @@ class AccountPlatform extends GenericMixedMetric * * date("Y-m-d H:i:s") * - * @var DateTime + * @var \DateTime */ public $datetime; diff --git a/app/DataMapper/Analytics/AccountSignup.php b/app/DataMapper/Analytics/AccountSignup.php index ee8548468f16..49baf78a9bca 100644 --- a/app/DataMapper/Analytics/AccountSignup.php +++ b/app/DataMapper/Analytics/AccountSignup.php @@ -37,7 +37,7 @@ class AccountSignup extends GenericMixedMetric * * date("Y-m-d H:i:s") * - * @var DateTime + * @var \DateTime */ public $datetime; diff --git a/app/DataMapper/Analytics/BankAccountsCreated.php b/app/DataMapper/Analytics/BankAccountsCreated.php index 494a5e40d0be..18d05e3a145e 100644 --- a/app/DataMapper/Analytics/BankAccountsCreated.php +++ b/app/DataMapper/Analytics/BankAccountsCreated.php @@ -37,7 +37,7 @@ class BankAccountsCreated extends GenericMixedMetric * * date("Y-m-d H:i:s") * - * @var DateTime + * @var \DateTime */ public $datetime; diff --git a/app/DataMapper/Analytics/DbQuery.php b/app/DataMapper/Analytics/DbQuery.php index f0e4c779f1ae..6e9ac09f88d5 100644 --- a/app/DataMapper/Analytics/DbQuery.php +++ b/app/DataMapper/Analytics/DbQuery.php @@ -37,7 +37,7 @@ class DbQuery extends GenericMixedMetric * * date("Y-m-d H:i:s") * - * @var DateTime + * @var \DateTime */ public $datetime; diff --git a/app/DataMapper/Analytics/EmailCount.php b/app/DataMapper/Analytics/EmailCount.php index d8e50c4ad15e..ec41dbb4d5ba 100644 --- a/app/DataMapper/Analytics/EmailCount.php +++ b/app/DataMapper/Analytics/EmailCount.php @@ -37,7 +37,7 @@ class EmailCount extends GenericMixedMetric * * date("Y-m-d H:i:s") * - * @var DateTime + * @var \DateTime */ public $datetime; diff --git a/app/DataMapper/Analytics/EmailFailure.php b/app/DataMapper/Analytics/EmailFailure.php index 65fb590f823f..bd31ac13e43a 100644 --- a/app/DataMapper/Analytics/EmailFailure.php +++ b/app/DataMapper/Analytics/EmailFailure.php @@ -37,7 +37,7 @@ class EmailFailure extends GenericMixedMetric * * date("Y-m-d H:i:s") * - * @var DateTime + * @var \DateTime */ public $datetime; diff --git a/app/DataMapper/Analytics/EmailInvoiceFailure.php b/app/DataMapper/Analytics/EmailInvoiceFailure.php index a1ef868a654f..058f8c7cfea5 100644 --- a/app/DataMapper/Analytics/EmailInvoiceFailure.php +++ b/app/DataMapper/Analytics/EmailInvoiceFailure.php @@ -37,7 +37,7 @@ class EmailInvoiceFailure extends GenericMixedMetric * * date("Y-m-d H:i:s") * - * @var DateTime + * @var \DateTime */ public $datetime; diff --git a/app/DataMapper/Analytics/EmailSuccess.php b/app/DataMapper/Analytics/EmailSuccess.php index ec1ccc35da06..94ddf34ecdb4 100644 --- a/app/DataMapper/Analytics/EmailSuccess.php +++ b/app/DataMapper/Analytics/EmailSuccess.php @@ -37,7 +37,7 @@ class EmailSuccess extends GenericMixedMetric * * date("Y-m-d H:i:s") * - * @var DateTime + * @var \DateTime */ public $datetime; diff --git a/app/DataMapper/Analytics/LivePreview.php b/app/DataMapper/Analytics/LivePreview.php index c2abf7470020..7cf062b75c71 100644 --- a/app/DataMapper/Analytics/LivePreview.php +++ b/app/DataMapper/Analytics/LivePreview.php @@ -37,7 +37,7 @@ class LivePreview extends GenericCounter * * date("Y-m-d H:i:s") * - * @var DateTime + * @var \DateTime */ public $datetime; diff --git a/app/DataMapper/Analytics/LoginFailure.php b/app/DataMapper/Analytics/LoginFailure.php index 474989fe91c1..954c1edb1fec 100644 --- a/app/DataMapper/Analytics/LoginFailure.php +++ b/app/DataMapper/Analytics/LoginFailure.php @@ -37,7 +37,7 @@ class LoginFailure extends GenericCounter * * date("Y-m-d H:i:s") * - * @var DateTime + * @var \DateTime */ public $datetime; diff --git a/app/DataMapper/Analytics/LoginSuccess.php b/app/DataMapper/Analytics/LoginSuccess.php index e24ea25b9048..00099a1b458f 100644 --- a/app/DataMapper/Analytics/LoginSuccess.php +++ b/app/DataMapper/Analytics/LoginSuccess.php @@ -37,7 +37,7 @@ class LoginSuccess extends GenericCounter * * date("Y-m-d H:i:s") * - * @var DateTime + * @var \DateTime */ public $datetime; diff --git a/app/DataMapper/Analytics/Mail/EmailBounce.php b/app/DataMapper/Analytics/Mail/EmailBounce.php index f7a0d098e2c1..7605447d346a 100644 --- a/app/DataMapper/Analytics/Mail/EmailBounce.php +++ b/app/DataMapper/Analytics/Mail/EmailBounce.php @@ -37,7 +37,7 @@ class EmailBounce extends GenericMixedMetric * * date("Y-m-d H:i:s") * - * @var DateTime + * @var \DateTime */ public $datetime; diff --git a/app/DataMapper/Analytics/Mail/EmailSpam.php b/app/DataMapper/Analytics/Mail/EmailSpam.php index 78289e7968fa..d5a4bd14553f 100644 --- a/app/DataMapper/Analytics/Mail/EmailSpam.php +++ b/app/DataMapper/Analytics/Mail/EmailSpam.php @@ -37,7 +37,7 @@ class EmailSpam extends GenericMixedMetric * * date("Y-m-d H:i:s") * - * @var DateTime + * @var \DateTime */ public $datetime; diff --git a/app/DataMapper/Analytics/MigrationFailure.php b/app/DataMapper/Analytics/MigrationFailure.php index 30f5fafe7bbe..42e9fcb7af7a 100644 --- a/app/DataMapper/Analytics/MigrationFailure.php +++ b/app/DataMapper/Analytics/MigrationFailure.php @@ -37,7 +37,7 @@ class MigrationFailure extends GenericMixedMetric * * date("Y-m-d H:i:s") * - * @var DateTime + * @var \DateTime */ public $datetime; diff --git a/app/DataMapper/Analytics/QueueSize.php b/app/DataMapper/Analytics/QueueSize.php index 98816e06226b..b489d3f0f10d 100644 --- a/app/DataMapper/Analytics/QueueSize.php +++ b/app/DataMapper/Analytics/QueueSize.php @@ -37,7 +37,7 @@ class QueueSize extends GenericMixedMetric * * date("Y-m-d H:i:s") * - * @var DateTime + * @var \DateTime */ public $datetime; diff --git a/app/DataMapper/Analytics/SendRecurringFailure.php b/app/DataMapper/Analytics/SendRecurringFailure.php index 1d35e6da7410..1ddf02cbeb3f 100644 --- a/app/DataMapper/Analytics/SendRecurringFailure.php +++ b/app/DataMapper/Analytics/SendRecurringFailure.php @@ -37,7 +37,7 @@ class SendRecurringFailure extends GenericMixedMetric * * date("Y-m-d H:i:s") * - * @var DateTime + * @var \DateTime */ public $datetime; diff --git a/app/DataMapper/Analytics/TrialFinished.php b/app/DataMapper/Analytics/TrialFinished.php index 4ca9dd8b1ee4..69f1c5db69cc 100644 --- a/app/DataMapper/Analytics/TrialFinished.php +++ b/app/DataMapper/Analytics/TrialFinished.php @@ -37,7 +37,7 @@ class TrialFinished extends GenericCounter * * date("Y-m-d H:i:s") * - * @var DateTime + * @var \DateTime */ public $datetime; diff --git a/app/DataMapper/Analytics/TrialStarted.php b/app/DataMapper/Analytics/TrialStarted.php index 0b6a1d9c7ba5..15bba1be6782 100644 --- a/app/DataMapper/Analytics/TrialStarted.php +++ b/app/DataMapper/Analytics/TrialStarted.php @@ -37,7 +37,7 @@ class TrialStarted extends GenericCounter * * date("Y-m-d H:i:s") * - * @var DateTime + * @var \DateTime */ public $datetime; diff --git a/app/Events/Design/DesignWasArchived.php b/app/Events/Design/DesignWasArchived.php index 898bc0b9031f..9e9faeca1287 100644 --- a/app/Events/Design/DesignWasArchived.php +++ b/app/Events/Design/DesignWasArchived.php @@ -26,29 +26,8 @@ class DesignWasArchived { use Dispatchable, InteractsWithSockets, SerializesModels; - /** - * @var Design - */ - public $design; - - public $company; - - public $event_vars; - - /** - * Create a new event instance. - * - * @param Design $design - * @param Company $company - * @param array $event_vars - */ - public function __construct(Design $design, Company $company, array $event_vars) + public function __construct(public Design $design, public Company $company, public array $event_vars) { - $this->design = $design; - - $this->company = $company; - - $this->event_vars = $event_vars; } /** diff --git a/app/Events/Design/DesignWasCreated.php b/app/Events/Design/DesignWasCreated.php index 6f005f1b86d7..704376f3a743 100644 --- a/app/Events/Design/DesignWasCreated.php +++ b/app/Events/Design/DesignWasCreated.php @@ -11,9 +11,10 @@ namespace App\Events\Design; -use App\Models\Company; use App\Models\Design; +use App\Models\Company; use Illuminate\Queue\SerializesModels; +use Illuminate\Broadcasting\PrivateChannel; /** * Class DesignWasCreated. @@ -22,29 +23,8 @@ class DesignWasCreated { use SerializesModels; - /** - * @var Design - */ - public $design; - - public $company; - - public $event_vars; - - /** - * Create a new event instance. - * - * @param Design $design - * @param Company $company - * @param array $event_vars - */ - public function __construct(Design $design, Company $company, array $event_vars) + public function __construct(public Design $design, public Company $company, public array $event_vars) { - $this->design = $design; - - $this->company = $company; - - $this->event_vars = $event_vars; } /** diff --git a/app/Events/Design/DesignWasDeleted.php b/app/Events/Design/DesignWasDeleted.php index b0f147961392..dcdea29838de 100644 --- a/app/Events/Design/DesignWasDeleted.php +++ b/app/Events/Design/DesignWasDeleted.php @@ -11,9 +11,10 @@ namespace App\Events\Design; -use App\Models\Company; use App\Models\Design; +use App\Models\Company; use Illuminate\Queue\SerializesModels; +use Illuminate\Broadcasting\PrivateChannel; /** * Class DesignWasDeleted. @@ -22,29 +23,8 @@ class DesignWasDeleted { use SerializesModels; - /** - * @var Design - */ - public $design; - - public $company; - - public $event_vars; - - /** - * Create a new event instance. - * - * @param Design $design - * @param Company $company - * @param array $event_vars - */ - public function __construct(Design $design, Company $company, array $event_vars) + public function __construct(public Design $design, public Company $company, public array $event_vars) { - $this->design = $design; - - $this->company = $company; - - $this->event_vars = $event_vars; } /** diff --git a/app/Events/Design/DesignWasRestored.php b/app/Events/Design/DesignWasRestored.php index e1a52463af94..ea23c836d926 100644 --- a/app/Events/Design/DesignWasRestored.php +++ b/app/Events/Design/DesignWasRestored.php @@ -11,9 +11,10 @@ namespace App\Events\Design; -use App\Models\Company; use App\Models\Design; +use App\Models\Company; use Illuminate\Queue\SerializesModels; +use Illuminate\Broadcasting\PrivateChannel; /** * Class DesignWasRestored. @@ -22,33 +23,8 @@ class DesignWasRestored { use SerializesModels; - /** - * @var Design - */ - public $design; - - public $company; - - public $event_vars; - - public $fromDeleted; - - /** - * Create a new event instance. - * - * @param Design $design - * @param Company $company - * @param array $event_vars - */ - public function __construct(Design $design, $fromDeleted, Company $company, array $event_vars) + public function __construct(public Design $design, public Company $company, public array $event_vars) { - $this->design = $design; - - $this->fromDeleted = $fromDeleted; - - $this->company = $company; - - $this->event_vars = $event_vars; } /** diff --git a/app/Events/Design/DesignWasUpdated.php b/app/Events/Design/DesignWasUpdated.php index 18ec8c634d14..6052e806947e 100644 --- a/app/Events/Design/DesignWasUpdated.php +++ b/app/Events/Design/DesignWasUpdated.php @@ -11,9 +11,10 @@ namespace App\Events\Design; -use App\Models\Company; use App\Models\Design; +use App\Models\Company; use Illuminate\Queue\SerializesModels; +use Illuminate\Broadcasting\PrivateChannel; /** * Class DesignWasUpdated. @@ -22,29 +23,8 @@ class DesignWasUpdated { use SerializesModels; - /** - * @var Design - */ - public $design; - - public $company; - - public $event_vars; - - /** - * Create a new event instance. - * - * @param Design $design - * @param Company $company - * @param array $event_vars - */ - public function __construct(Design $design, Company $company, array $event_vars) + public function __construct(public Design $design, public Company $company, public array $event_vars) { - $this->design = $design; - - $this->company = $company; - - $this->event_vars = $event_vars; } /** diff --git a/app/Events/Invoice/InvoiceWasViewed.php b/app/Events/Invoice/InvoiceWasViewed.php index cd3ba6a6f385..81a64574a4ea 100644 --- a/app/Events/Invoice/InvoiceWasViewed.php +++ b/app/Events/Invoice/InvoiceWasViewed.php @@ -22,14 +22,6 @@ class InvoiceWasViewed { use SerializesModels; - /** - * @var Invoice - */ - public $invitation; - - public $company; - - public $event_vars; /** * Create a new event instance. @@ -38,10 +30,7 @@ class InvoiceWasViewed * @param Company $company * @param array $event_vars */ - public function __construct(InvoiceInvitation $invitation, Company $company, array $event_vars) + public function __construct(public InvoiceInvitation $invitation, Company $company, array $event_vars) { - $this->invitation = $invitation; - $this->company = $company; - $this->event_vars = $event_vars; } } diff --git a/app/Events/Product/ProductWasRestored.php b/app/Events/Product/ProductWasRestored.php index 88353d47da58..b19ad5eef8c4 100644 --- a/app/Events/Product/ProductWasRestored.php +++ b/app/Events/Product/ProductWasRestored.php @@ -22,29 +22,7 @@ class ProductWasRestored { use SerializesModels; - /** - * @var Product - */ - public $invoice; - - public $company; - - public $event_vars; - - public $fromDeleted; - - /** - * Create a new event instance. - * - * @param Product $invoice - * @param Company $company - * @param array $event_vars - */ - public function __construct(Product $product, $fromDeleted, Company $company, array $event_vars) + public function __construct(public Product $product, public bool $fromDeleted, public Company $company, public array $event_vars) { - $this->product = $product; - $this->fromDeleted = $fromDeleted; - $this->company = $company; - $this->event_vars = $event_vars; } } diff --git a/app/Models/Account.php b/app/Models/Account.php index d6ce88c69d68..13197449e5f6 100644 --- a/app/Models/Account.php +++ b/app/Models/Account.php @@ -174,6 +174,10 @@ use Laracasts\Presenter\PresentableTrait; * @property-read \Illuminate\Database\Eloquent\Collection $companies * @property-read \Illuminate\Database\Eloquent\Collection $company_users * @property-read \Illuminate\Database\Eloquent\Collection $users + * @property-read \Illuminate\Database\Eloquent\Collection $bank_integrations + * @property-read \Illuminate\Database\Eloquent\Collection $companies + * @property-read \Illuminate\Database\Eloquent\Collection $company_users + * @property-read \Illuminate\Database\Eloquent\Collection $users * @mixin \Eloquent */ class Account extends BaseModel diff --git a/app/Models/BankAccount.php b/app/Models/BankAccount.php index 9550b136d51a..5b4abddc9a96 100644 --- a/app/Models/BankAccount.php +++ b/app/Models/BankAccount.php @@ -43,6 +43,7 @@ use Illuminate\Database\Eloquent\SoftDeletes; * @property-read \Illuminate\Database\Eloquent\Collection $bank_subaccounts * @property-read \Illuminate\Database\Eloquent\Collection $bank_subaccounts * @property-read \Illuminate\Database\Eloquent\Collection $bank_subaccounts + * @property-read \Illuminate\Database\Eloquent\Collection $bank_subaccounts * @mixin \Eloquent */ class BankAccount extends BaseModel diff --git a/app/Models/BankIntegration.php b/app/Models/BankIntegration.php index ca61f7951c23..5205e2467eb2 100644 --- a/app/Models/BankIntegration.php +++ b/app/Models/BankIntegration.php @@ -86,6 +86,7 @@ use Illuminate\Database\Eloquent\SoftDeletes; * @property-read \Illuminate\Database\Eloquent\Collection $transactions * @property-read \Illuminate\Database\Eloquent\Collection $transactions * @property-read \Illuminate\Database\Eloquent\Collection $transactions + * @property-read \Illuminate\Database\Eloquent\Collection $transactions * @mixin \Eloquent */ class BankIntegration extends BaseModel diff --git a/app/Models/Client.php b/app/Models/Client.php index fb130dbf8825..774e2807dabf 100644 --- a/app/Models/Client.php +++ b/app/Models/Client.php @@ -365,6 +365,23 @@ use Laracasts\Presenter\PresentableTrait; * @property-read \Illuminate\Database\Eloquent\Collection $system_logs * @property-read \Illuminate\Database\Eloquent\Collection $tasks * @method static \Illuminate\Database\Eloquent\Builder|Client whereRoutingId($value) + * @property-read \Illuminate\Database\Eloquent\Collection $activities + * @property-read \Illuminate\Database\Eloquent\Collection $company_ledger + * @property-read \Illuminate\Database\Eloquent\Collection $contacts + * @property-read \Illuminate\Database\Eloquent\Collection $credits + * @property-read \Illuminate\Database\Eloquent\Collection $documents + * @property-read \Illuminate\Database\Eloquent\Collection $expenses + * @property-read \Illuminate\Database\Eloquent\Collection $gateway_tokens + * @property-read \Illuminate\Database\Eloquent\Collection $invoices + * @property-read \Illuminate\Database\Eloquent\Collection $ledger + * @property-read \Illuminate\Database\Eloquent\Collection $payments + * @property-read \Illuminate\Database\Eloquent\Collection $primary_contact + * @property-read \Illuminate\Database\Eloquent\Collection $projects + * @property-read \Illuminate\Database\Eloquent\Collection $quotes + * @property-read \Illuminate\Database\Eloquent\Collection $recurring_expenses + * @property-read \Illuminate\Database\Eloquent\Collection $recurring_invoices + * @property-read \Illuminate\Database\Eloquent\Collection $system_logs + * @property-read \Illuminate\Database\Eloquent\Collection $tasks * @mixin \Eloquent */ class Client extends BaseModel implements HasLocalePreference diff --git a/app/Models/ClientContact.php b/app/Models/ClientContact.php index 3eb998b68176..5f3254d14cf5 100644 --- a/app/Models/ClientContact.php +++ b/app/Models/ClientContact.php @@ -178,6 +178,11 @@ use Laracasts\Presenter\PresentableTrait; * @property-read \Illuminate\Notifications\DatabaseNotificationCollection $notifications * @property-read \Illuminate\Database\Eloquent\Collection $quote_invitations * @property-read \Illuminate\Database\Eloquent\Collection $recurring_invoice_invitations + * @property-read \Illuminate\Database\Eloquent\Collection $credit_invitations + * @property-read \Illuminate\Database\Eloquent\Collection $invoice_invitations + * @property-read \Illuminate\Notifications\DatabaseNotificationCollection $notifications + * @property-read \Illuminate\Database\Eloquent\Collection $quote_invitations + * @property-read \Illuminate\Database\Eloquent\Collection $recurring_invoice_invitations * @mixin \Eloquent */ class ClientContact extends Authenticatable implements HasLocalePreference diff --git a/app/Models/Company.php b/app/Models/Company.php index e4bcfca7aa7b..87239b74c171 100644 --- a/app/Models/Company.php +++ b/app/Models/Company.php @@ -777,6 +777,50 @@ use Laracasts\Presenter\PresentableTrait; * @property-read \Illuminate\Database\Eloquent\Collection $vendors * @property-read \Illuminate\Database\Eloquent\Collection $webhooks * @method static \Illuminate\Database\Eloquent\Builder|Company whereEnableEInvoice($value) + * @property-read \Illuminate\Database\Eloquent\Collection $activities + * @property-read \Illuminate\Database\Eloquent\Collection $all_activities + * @property-read \Illuminate\Database\Eloquent\Collection $all_documents + * @property-read \Illuminate\Database\Eloquent\Collection $bank_integrations + * @property-read \Illuminate\Database\Eloquent\Collection $bank_transaction_rules + * @property-read \Illuminate\Database\Eloquent\Collection $bank_transactions + * @property-read \Illuminate\Database\Eloquent\Collection $client_contacts + * @property-read \Illuminate\Database\Eloquent\Collection $client_gateway_tokens + * @property-read \Illuminate\Database\Eloquent\Collection $clients + * @property-read \Illuminate\Database\Eloquent\Collection $company_gateways + * @property-read \Illuminate\Database\Eloquent\Collection $company_users + * @property-read \Illuminate\Database\Eloquent\Collection $contacts + * @property-read \Illuminate\Database\Eloquent\Collection $credits + * @property-read \Illuminate\Database\Eloquent\Collection $designs + * @property-read \Illuminate\Database\Eloquent\Collection $documents + * @property-read \Illuminate\Database\Eloquent\Collection $expense_categories + * @property-read \Illuminate\Database\Eloquent\Collection $expenses + * @property-read \Illuminate\Database\Eloquent\Collection $group_settings + * @property-read \Illuminate\Database\Eloquent\Collection $groups + * @property-read \Illuminate\Database\Eloquent\Collection $invoices + * @property-read \Illuminate\Database\Eloquent\Collection $ledger + * @property-read \Illuminate\Database\Eloquent\Collection $payment_terms + * @property-read \Illuminate\Database\Eloquent\Collection $payments + * @property-read \Illuminate\Database\Eloquent\Collection $products + * @property-read \Illuminate\Database\Eloquent\Collection $projects + * @property-read \Illuminate\Database\Eloquent\Collection $purchase_orders + * @property-read \Illuminate\Database\Eloquent\Collection $quotes + * @property-read \Illuminate\Database\Eloquent\Collection $recurring_expenses + * @property-read \Illuminate\Database\Eloquent\Collection $recurring_invoices + * @property-read \Illuminate\Database\Eloquent\Collection $schedulers + * @property-read \Illuminate\Database\Eloquent\Collection $subscriptions + * @property-read \Illuminate\Database\Eloquent\Collection $system_log_relation + * @property-read \Illuminate\Database\Eloquent\Collection $system_logs + * @property-read \Illuminate\Database\Eloquent\Collection $task_schedulers + * @property-read \Illuminate\Database\Eloquent\Collection $task_statuses + * @property-read \Illuminate\Database\Eloquent\Collection $tasks + * @property-read \Illuminate\Database\Eloquent\Collection $tax_rates + * @property-read \Illuminate\Database\Eloquent\Collection $tokens + * @property-read \Illuminate\Database\Eloquent\Collection $tokens_hashed + * @property-read \Illuminate\Database\Eloquent\Collection $user_designs + * @property-read \Illuminate\Database\Eloquent\Collection $user_payment_terms + * @property-read \Illuminate\Database\Eloquent\Collection $users + * @property-read \Illuminate\Database\Eloquent\Collection $vendors + * @property-read \Illuminate\Database\Eloquent\Collection $webhooks * @mixin \Eloquent */ class Company extends BaseModel diff --git a/app/Models/CompanyGateway.php b/app/Models/CompanyGateway.php index 059ad639a381..788d4b17d683 100644 --- a/app/Models/CompanyGateway.php +++ b/app/Models/CompanyGateway.php @@ -103,6 +103,7 @@ use Illuminate\Database\Eloquent\SoftDeletes; * @property-read \Illuminate\Database\Eloquent\Collection $client_gateway_tokens * @property-read \Illuminate\Database\Eloquent\Collection $client_gateway_tokens * @property-read \Illuminate\Database\Eloquent\Collection $client_gateway_tokens + * @property-read \Illuminate\Database\Eloquent\Collection $client_gateway_tokens * @mixin \Eloquent */ class CompanyGateway extends BaseModel diff --git a/app/Models/CompanyUser.php b/app/Models/CompanyUser.php index afab046e15ce..cb2b84117c50 100644 --- a/app/Models/CompanyUser.php +++ b/app/Models/CompanyUser.php @@ -100,6 +100,9 @@ use Illuminate\Database\Eloquent\SoftDeletes; * @property-read \Illuminate\Database\Eloquent\Collection $token * @property-read \Illuminate\Database\Eloquent\Collection $tokens * @property-read \Illuminate\Database\Eloquent\Collection $users + * @property-read \Illuminate\Database\Eloquent\Collection $token + * @property-read \Illuminate\Database\Eloquent\Collection $tokens + * @property-read \Illuminate\Database\Eloquent\Collection $users * @mixin \Eloquent */ class CompanyUser extends Pivot diff --git a/app/Models/Credit.php b/app/Models/Credit.php index cf6b322b9750..5d48faa809c0 100644 --- a/app/Models/Credit.php +++ b/app/Models/Credit.php @@ -262,6 +262,13 @@ use Laracasts\Presenter\PresentableTrait; * @property-read \Illuminate\Database\Eloquent\Collection $invitations * @property-read \Illuminate\Database\Eloquent\Collection $invoices * @property-read \Illuminate\Database\Eloquent\Collection $payments + * @property-read \Illuminate\Database\Eloquent\Collection $activities + * @property-read \Illuminate\Database\Eloquent\Collection $company_ledger + * @property-read \Illuminate\Database\Eloquent\Collection $documents + * @property-read \Illuminate\Database\Eloquent\Collection $history + * @property-read \Illuminate\Database\Eloquent\Collection $invitations + * @property-read \Illuminate\Database\Eloquent\Collection $invoices + * @property-read \Illuminate\Database\Eloquent\Collection $payments * @mixin \Eloquent */ class Credit extends BaseModel diff --git a/app/Models/Expense.php b/app/Models/Expense.php index 3f3b32f6f0d4..648e1d5635e9 100644 --- a/app/Models/Expense.php +++ b/app/Models/Expense.php @@ -142,6 +142,7 @@ use Illuminate\Database\Eloquent\SoftDeletes; * @property-read \App\Models\BankTransaction|null $transaction * @property-read \Illuminate\Database\Eloquent\Collection $documents * @property-read \Illuminate\Database\Eloquent\Collection $documents + * @property-read \Illuminate\Database\Eloquent\Collection $documents * @mixin \Eloquent */ class Expense extends BaseModel diff --git a/app/Models/GatewayType.php b/app/Models/GatewayType.php index 41c42f9c97d0..2ca4159cd3e1 100644 --- a/app/Models/GatewayType.php +++ b/app/Models/GatewayType.php @@ -39,6 +39,7 @@ namespace App\Models; * @property-read \Illuminate\Database\Eloquent\Collection $payment_methods * @property-read \Illuminate\Database\Eloquent\Collection $payment_methods * @property-read \Illuminate\Database\Eloquent\Collection $payment_methods + * @property-read \Illuminate\Database\Eloquent\Collection $payment_methods * @mixin \Eloquent */ class GatewayType extends StaticModel diff --git a/app/Models/GroupSetting.php b/app/Models/GroupSetting.php index f3a1799d40d9..8e2c99d6f27b 100644 --- a/app/Models/GroupSetting.php +++ b/app/Models/GroupSetting.php @@ -76,6 +76,8 @@ use Illuminate\Database\Eloquent\SoftDeletes; * @property-read \Illuminate\Database\Eloquent\Collection $documents * @property-read \Illuminate\Database\Eloquent\Collection $clients * @property-read \Illuminate\Database\Eloquent\Collection $documents + * @property-read \Illuminate\Database\Eloquent\Collection $clients + * @property-read \Illuminate\Database\Eloquent\Collection $documents * @mixin \Eloquent */ class GroupSetting extends StaticModel diff --git a/app/Models/Invoice.php b/app/Models/Invoice.php index 7ba08d7e7be5..0a3afb84aad6 100644 --- a/app/Models/Invoice.php +++ b/app/Models/Invoice.php @@ -304,6 +304,15 @@ use Laracasts\Presenter\PresentableTrait; * @property-read \Illuminate\Database\Eloquent\Collection $invitations * @property-read \Illuminate\Database\Eloquent\Collection $payments * @property-read \Illuminate\Database\Eloquent\Collection $tasks + * @property-read \Illuminate\Database\Eloquent\Collection $activities + * @property-read \Illuminate\Database\Eloquent\Collection $company_ledger + * @property-read \Illuminate\Database\Eloquent\Collection $credits + * @property-read \Illuminate\Database\Eloquent\Collection $documents + * @property-read \Illuminate\Database\Eloquent\Collection $expenses + * @property-read \Illuminate\Database\Eloquent\Collection $history + * @property-read \Illuminate\Database\Eloquent\Collection $invitations + * @property-read \Illuminate\Database\Eloquent\Collection $payments + * @property-read \Illuminate\Database\Eloquent\Collection $tasks * @mixin \Eloquent */ class Invoice extends BaseModel diff --git a/app/Models/Payment.php b/app/Models/Payment.php index adab70d5006a..ff40d6c8dbbf 100644 --- a/app/Models/Payment.php +++ b/app/Models/Payment.php @@ -187,6 +187,11 @@ use Illuminate\Database\Eloquent\SoftDeletes; * @property-read \Illuminate\Database\Eloquent\Collection $documents * @property-read \Illuminate\Database\Eloquent\Collection $invoices * @property-read \Illuminate\Database\Eloquent\Collection $paymentables + * @property-read \Illuminate\Database\Eloquent\Collection $company_ledger + * @property-read \Illuminate\Database\Eloquent\Collection $credits + * @property-read \Illuminate\Database\Eloquent\Collection $documents + * @property-read \Illuminate\Database\Eloquent\Collection $invoices + * @property-read \Illuminate\Database\Eloquent\Collection $paymentables * @mixin \Eloquent */ class Payment extends BaseModel diff --git a/app/Models/Product.php b/app/Models/Product.php index 86f4aa57e0d3..98c7af855c30 100644 --- a/app/Models/Product.php +++ b/app/Models/Product.php @@ -109,6 +109,7 @@ use League\CommonMark\CommonMarkConverter; * @property-read \Illuminate\Database\Eloquent\Collection $documents * @property-read \Illuminate\Database\Eloquent\Collection $documents * @property-read \Illuminate\Database\Eloquent\Collection $documents + * @property-read \Illuminate\Database\Eloquent\Collection $documents * @mixin \Eloquent */ class Product extends BaseModel diff --git a/app/Models/Project.php b/app/Models/Project.php index 40c2012df9ea..7e88c884072e 100644 --- a/app/Models/Project.php +++ b/app/Models/Project.php @@ -96,6 +96,8 @@ use Laracasts\Presenter\PresentableTrait; * @property-read \Illuminate\Database\Eloquent\Collection $tasks * @property-read \Illuminate\Database\Eloquent\Collection $documents * @property-read \Illuminate\Database\Eloquent\Collection $tasks + * @property-read \Illuminate\Database\Eloquent\Collection $documents + * @property-read \Illuminate\Database\Eloquent\Collection $tasks * @mixin \Eloquent */ class Project extends BaseModel diff --git a/app/Models/Proposal.php b/app/Models/Proposal.php index 169a6f999cf4..30e0a23c0c07 100644 --- a/app/Models/Proposal.php +++ b/app/Models/Proposal.php @@ -39,6 +39,7 @@ use App\Utils\Traits\MakesHash; * @property-read \Illuminate\Database\Eloquent\Collection $documents * @property-read \Illuminate\Database\Eloquent\Collection $documents * @property-read \Illuminate\Database\Eloquent\Collection $documents + * @property-read \Illuminate\Database\Eloquent\Collection $documents * @mixin \Eloquent */ class Proposal extends BaseModel diff --git a/app/Models/PurchaseOrder.php b/app/Models/PurchaseOrder.php index 4c132337e129..17ce85cfeced 100644 --- a/app/Models/PurchaseOrder.php +++ b/app/Models/PurchaseOrder.php @@ -246,6 +246,12 @@ use Illuminate\Support\Facades\Storage; * @property-read \Illuminate\Database\Eloquent\Collection $invitations * @property-read \Illuminate\Database\Eloquent\Collection $invoices * @property-read \Illuminate\Database\Eloquent\Collection $payments + * @property-read \Illuminate\Database\Eloquent\Collection $activities + * @property-read \Illuminate\Database\Eloquent\Collection $documents + * @property-read \Illuminate\Database\Eloquent\Collection $history + * @property-read \Illuminate\Database\Eloquent\Collection $invitations + * @property-read \Illuminate\Database\Eloquent\Collection $invoices + * @property-read \Illuminate\Database\Eloquent\Collection $payments * @mixin \Eloquent */ class PurchaseOrder extends BaseModel diff --git a/app/Models/Quote.php b/app/Models/Quote.php index b7b6055969c5..b04a848bcaf0 100644 --- a/app/Models/Quote.php +++ b/app/Models/Quote.php @@ -225,6 +225,10 @@ use Laracasts\Presenter\PresentableTrait; * @property-read \Illuminate\Database\Eloquent\Collection $documents * @property-read \Illuminate\Database\Eloquent\Collection $history * @property-read \Illuminate\Database\Eloquent\Collection $invitations + * @property-read \Illuminate\Database\Eloquent\Collection $activities + * @property-read \Illuminate\Database\Eloquent\Collection $documents + * @property-read \Illuminate\Database\Eloquent\Collection $history + * @property-read \Illuminate\Database\Eloquent\Collection $invitations * @mixin \Eloquent */ class Quote extends BaseModel diff --git a/app/Models/RecurringExpense.php b/app/Models/RecurringExpense.php index bce2f6a60414..642aa099858a 100644 --- a/app/Models/RecurringExpense.php +++ b/app/Models/RecurringExpense.php @@ -150,6 +150,7 @@ use Illuminate\Support\Carbon; * @property-read \Illuminate\Database\Eloquent\Collection $documents * @property-read \Illuminate\Database\Eloquent\Collection $documents * @property-read \Illuminate\Database\Eloquent\Collection $documents + * @property-read \Illuminate\Database\Eloquent\Collection $documents * @mixin \Eloquent */ class RecurringExpense extends BaseModel diff --git a/app/Models/RecurringInvoice.php b/app/Models/RecurringInvoice.php index 9eb4e272a6d2..67286724cbdd 100644 --- a/app/Models/RecurringInvoice.php +++ b/app/Models/RecurringInvoice.php @@ -234,6 +234,11 @@ use Laracasts\Presenter\PresentableTrait; * @property-read \Illuminate\Database\Eloquent\Collection $history * @property-read \Illuminate\Database\Eloquent\Collection $invitations * @property-read \Illuminate\Database\Eloquent\Collection $invoices + * @property-read \Illuminate\Database\Eloquent\Collection $activities + * @property-read \Illuminate\Database\Eloquent\Collection $documents + * @property-read \Illuminate\Database\Eloquent\Collection $history + * @property-read \Illuminate\Database\Eloquent\Collection $invitations + * @property-read \Illuminate\Database\Eloquent\Collection $invoices * @mixin \Eloquent */ class RecurringInvoice extends BaseModel diff --git a/app/Models/RecurringQuote.php b/app/Models/RecurringQuote.php index fb54c34457a3..dcb68027f0c2 100644 --- a/app/Models/RecurringQuote.php +++ b/app/Models/RecurringQuote.php @@ -226,6 +226,11 @@ use Laracasts\Presenter\PresentableTrait; * @property-read \Illuminate\Database\Eloquent\Collection $history * @property-read \Illuminate\Database\Eloquent\Collection $invitations * @property-read \Illuminate\Database\Eloquent\Collection $quotes + * @property-read \Illuminate\Database\Eloquent\Collection $activities + * @property-read \Illuminate\Database\Eloquent\Collection $documents + * @property-read \Illuminate\Database\Eloquent\Collection $history + * @property-read \Illuminate\Database\Eloquent\Collection $invitations + * @property-read \Illuminate\Database\Eloquent\Collection $quotes * @mixin \Eloquent */ class RecurringQuote extends BaseModel diff --git a/app/Models/Task.php b/app/Models/Task.php index c6500ec00d5d..aaf2256f3cef 100644 --- a/app/Models/Task.php +++ b/app/Models/Task.php @@ -102,6 +102,7 @@ use Illuminate\Support\Carbon; * @property-read \Illuminate\Database\Eloquent\Collection $documents * @property-read \Illuminate\Database\Eloquent\Collection $documents * @property-read \Illuminate\Database\Eloquent\Collection $documents + * @property-read \Illuminate\Database\Eloquent\Collection $documents * @mixin \Eloquent */ class Task extends BaseModel diff --git a/app/Models/User.php b/app/Models/User.php index 2b4d6ffe212b..0abe8a829352 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -216,6 +216,13 @@ use Laracasts\Presenter\PresentableTrait; * @property-read \Illuminate\Database\Eloquent\Collection $documents * @property-read \Illuminate\Notifications\DatabaseNotificationCollection $notifications * @property-read \Illuminate\Database\Eloquent\Collection $tokens + * @property-read \Illuminate\Database\Eloquent\Collection $clients + * @property-read \Illuminate\Database\Eloquent\Collection $companies + * @property-read \Illuminate\Database\Eloquent\Collection $company_users + * @property-read \Illuminate\Database\Eloquent\Collection $contacts + * @property-read \Illuminate\Database\Eloquent\Collection $documents + * @property-read \Illuminate\Notifications\DatabaseNotificationCollection $notifications + * @property-read \Illuminate\Database\Eloquent\Collection $tokens * @mixin \Eloquent */ class User extends Authenticatable implements MustVerifyEmail diff --git a/app/Models/Vendor.php b/app/Models/Vendor.php index eb0ff47125c7..e7eeae12c41a 100644 --- a/app/Models/Vendor.php +++ b/app/Models/Vendor.php @@ -148,6 +148,10 @@ use Laracasts\Presenter\PresentableTrait; * @property-read \Illuminate\Database\Eloquent\Collection $contacts * @property-read \Illuminate\Database\Eloquent\Collection $documents * @property-read \Illuminate\Database\Eloquent\Collection $primary_contact + * @property-read \Illuminate\Database\Eloquent\Collection $activities + * @property-read \Illuminate\Database\Eloquent\Collection $contacts + * @property-read \Illuminate\Database\Eloquent\Collection $documents + * @property-read \Illuminate\Database\Eloquent\Collection $primary_contact * @mixin \Eloquent */ class Vendor extends BaseModel diff --git a/app/Models/VendorContact.php b/app/Models/VendorContact.php index 3e68710494bc..e78715903a71 100644 --- a/app/Models/VendorContact.php +++ b/app/Models/VendorContact.php @@ -132,6 +132,8 @@ use Laracasts\Presenter\PresentableTrait; * @property-read \Illuminate\Database\Eloquent\Collection $purchase_order_invitations * @property-read \Illuminate\Notifications\DatabaseNotificationCollection $notifications * @property-read \Illuminate\Database\Eloquent\Collection $purchase_order_invitations + * @property-read \Illuminate\Notifications\DatabaseNotificationCollection $notifications + * @property-read \Illuminate\Database\Eloquent\Collection $purchase_order_invitations * @mixin \Eloquent */ class VendorContact extends Authenticatable implements HasLocalePreference diff --git a/tests/Feature/DesignApiTest.php b/tests/Feature/DesignApiTest.php index dec0cc00bed7..71583103d181 100644 --- a/tests/Feature/DesignApiTest.php +++ b/tests/Feature/DesignApiTest.php @@ -46,6 +46,15 @@ class DesignApiTest extends TestCase public function testDesignPost() { + + $this->expectsEvents([ + TaskWasCreated::class, + TaskWasUpdated::class, + // TaskWasArchived::class, + // TaskWasRestored::class, + // TaskWasDeleted::class, + ]); + $design = [ 'body' => 'body', 'includes' => 'includes', @@ -127,6 +136,14 @@ class DesignApiTest extends TestCase public function testDesignArchive() { + + $this->expectsEvents([ + TaskWasArchived::class, + TaskWasRestored::class, + TaskWasDeleted::class, + ]); + + $design = [ 'body' => 'body', 'includes' => 'includes',