Example #1
0
            $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();
});