{ $token = $this->getGatewayToken(); return $token ? "https://dashboard.stripe.com/customers/{$token}" : false; } public function getCurrencyId() { if ($this->currency_id) { return $this->currency_id; } if (!$this->account) { $this->load('account'); } return $this->account->currency_id ?: DEFAULT_CURRENCY; } } /* Client::created(function($client) { Activity::createClient($client); }); */ Client::updating(function ($client) { Activity::updateClient($client); }); Client::deleting(function ($client) { Activity::archiveClient($client); }); /*Client::restoring(function ($client) { Activity::restoreClient($client); }); */
$this->load('account'); } return $this->account->currency ? $this->account->currency->code : 'USD'; } /** * @param $isQuote * @return mixed */ public function getCounter($isQuote) { return $isQuote ? $this->quote_number_counter : $this->invoice_number_counter; } public function markLoggedIn() { $this->last_login = Carbon::now()->toDateTimeString(); $this->save(); } /** * @return bool */ public function hasAutoBillConfigurableInvoices() { return $this->invoices()->whereIn('auto_bill', [AUTO_BILL_OPT_IN, AUTO_BILL_OPT_OUT])->count() > 0; } } Client::creating(function ($client) { $client->setNullValues(); }); Client::updating(function ($client) { $client->setNullValues(); });