account = $account; $this->invoice = $invoice; } /** * Execute the console command. * * @return mixed */ public function handle() { $latestInvoice = $this->invoice->latest()->first(); $invoiceYear = Carbon::parse($latestInvoice->created_at)->year; if(Carbon::now()->year > $invoiceYear || $this->option('force')) { $this->account->invoice_number_counter = 1; $this->account->update(); } } }