sarga/packages/Webkul/Customer/src/Models/Customer.php

43 lines
1004 B
PHP
Raw Normal View History

<?php
namespace Webkul\Customer\Models;
use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;
2018-09-08 08:41:36 +00:00
use Webkul\Customer\Models\CustomersGroups;
// use Webkul\User\Notifications\AdminResetPassword;
// use Webkul\User\Notifications\AdminResetPassword;
class Customer extends Authenticatable
{
use Notifiable;
protected $table = 'customers';
2018-09-08 08:41:36 +00:00
2018-09-08 08:52:46 +00:00
protected $fillable = ['first_name', 'last_name', 'gender', 'date_of_birth','phone','email','password','customer_group_id','subscribed_to_news_letter'];
2018-09-08 08:41:36 +00:00
2018-07-27 13:37:56 +00:00
protected $hidden = ['password','remember_token'];
2018-08-30 13:22:15 +00:00
2018-09-08 08:41:36 +00:00
protected $with = ['customerGroup'];
/**
* Get the customer full name.
*/
2018-08-30 13:22:15 +00:00
public function getNameAttribute() {
return ucfirst($this->first_name) . ' ' . ucfirst($this->last_name);
}
2018-09-08 08:41:36 +00:00
/**
* Get the customer group that owns the customer.
*/
public function customerGroup()
{
return $this->belongsTo(CustomersGroups::class);
}
}