first_name) . ' ' . ucfirst($this->last_name); } /** * Get the customer group that owns the customer. */ public function group() { return $this->belongsTo(CustomerGroupProxy::modelClass(), 'customer_group_id'); } /** * Send the password reset notification. * * @param string $token * @return void */ public function sendPasswordResetNotification($token) { $this->notify(new CustomerResetPassword($token)); } /** * Get the customer address that owns the customer. */ public function addresses() { return $this->hasMany(CustomerAddressProxy::modelClass(), 'customer_id'); } /** * Get default customer address that owns the customer. */ public function default_address() { return $this->hasOne(CustomerAddressProxy::modelClass(), 'customer_id')->where('default_address', 1); } /** * Customer's relation with wishlist items */ public function wishlist_items() { return $this->hasMany(WishlistProxy::modelClass(), 'customer_id'); } /** * get all cart inactive cart instance of a customer */ public function all_carts() { return $this->hasMany(CartProxy::modelClass(), 'customer_id'); } /** * get inactive cart inactive cart instance of a customer */ public function inactive_carts() { return $this->hasMany(CartProxy::modelClass(), 'customer_id')->where('is_active', 0); } /** * get active cart inactive cart instance of a customer */ public function active_carts() { return $this->hasMany(CartProxy::modelClass(), 'customer_id')->where('is_active', 1); } /** * get all reviews of a customer */ public function all_reviews() { return $this->hasMany(ProductReviewProxy::modelClass(), 'customer_id'); } /** * get all orders of a customer */ public function all_orders() { return $this->hasMany(OrderProxy::modelClass(), 'customer_id'); } /** * Get the identifier that will be stored in the subject claim of the JWT. * * @return mixed */ public function getJWTIdentifier() { return $this->getKey(); } /** * Return a key value array, containing any custom claims to be added to the JWT. * * @return array */ public function getJWTCustomClaims() { return []; } }