mirror of
https://github.com/crater-invoice/crater.git
synced 2025-10-27 19:51:09 -04:00
v6 update
This commit is contained in:
@ -3,6 +3,7 @@
|
||||
namespace Crater\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Crater\Notifications\CustomerMailResetPasswordNotification;
|
||||
use Crater\Traits\HasCustomFieldsTrait;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||
@ -39,6 +40,10 @@ class Customer extends Authenticatable implements HasMedia
|
||||
'avatar'
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'enable_portal' => 'boolean',
|
||||
];
|
||||
|
||||
public function getFormattedCreatedAtAttribute($value)
|
||||
{
|
||||
$dateFormat = CompanySetting::getSetting('carbon_date_format', $this->company_id);
|
||||
@ -108,6 +113,11 @@ class Customer extends Authenticatable implements HasMedia
|
||||
return $this->hasOne(Address::class)->where('type', Address::SHIPPING_TYPE);
|
||||
}
|
||||
|
||||
public function sendPasswordResetNotification($token)
|
||||
{
|
||||
$this->notify(new CustomerMailResetPasswordNotification($token));
|
||||
}
|
||||
|
||||
public function getAvatarAttribute()
|
||||
{
|
||||
$avatar = $this->getMedia('customer_avatar')->first();
|
||||
|
||||
Reference in New Issue
Block a user