v6 update

This commit is contained in:
Mohit Panjwani
2022-01-10 16:06:17 +05:30
parent b770e6277f
commit bdea879273
722 changed files with 19047 additions and 9186 deletions

View File

@ -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();