first_name) . ' ' . ucfirst($this->last_name); } /** * Get the customer group that owns the customer. */ public function customerGroup() { return $this->belongsTo(CustomerGroup::class); } /** * 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(CustomerAddress::class, 'customer_id'); } /** * Get default customer address that owns the customer. */ public function default_address() { return $this->hasOne(CustomerAddress::class, 'customer_id')->where('default_address', 1); } /** * Customer's relation with wishlist items */ public function wishlist_items() { return $this->hasMany(Wishlist::class, 'customer_id'); } /** * get all cart inactive cart instance of a customer */ public function carts() { return $this->hasMany(Cart::class, 'customer_id'); } /** * get inactive cart inactive cart instance of a customer */ public function inactive_carts() { return $this->hasMany(Cart::class, 'customer_id')->where('is_active', 0); } /** * get active cart inactive cart instance of a customer */ public function active_carts() { return $this->hasMany(Cart::class, 'customer_id')->where('is_active', 1); } }