2018-09-20 10:01:51 +00:00
|
|
|
<?php
|
|
|
|
|
|
2018-09-28 12:54:26 +00:00
|
|
|
namespace Webkul\Checkout\Models;
|
2018-09-20 10:01:51 +00:00
|
|
|
|
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
2019-02-18 07:30:40 +00:00
|
|
|
use Webkul\Checkout\Contracts\CartAddress as CartAddressContract;
|
2018-09-20 10:01:51 +00:00
|
|
|
|
2019-02-18 07:30:40 +00:00
|
|
|
class CartAddress extends Model implements CartAddressContract
|
2018-09-20 10:01:51 +00:00
|
|
|
{
|
2018-09-26 04:21:14 +00:00
|
|
|
protected $table = 'cart_address';
|
|
|
|
|
|
2020-02-26 06:37:17 +00:00
|
|
|
protected $fillable = [
|
|
|
|
|
'first_name',
|
|
|
|
|
'last_name',
|
|
|
|
|
'email',
|
|
|
|
|
'company_name',
|
|
|
|
|
'vat_id',
|
|
|
|
|
'address1',
|
|
|
|
|
'city',
|
|
|
|
|
'state',
|
|
|
|
|
'postcode',
|
|
|
|
|
'country',
|
|
|
|
|
'phone',
|
|
|
|
|
'address_type',
|
|
|
|
|
'cart_id',
|
2020-03-05 14:52:20 +00:00
|
|
|
'customer_id',
|
2020-03-04 06:32:53 +00:00
|
|
|
];
|
2018-09-26 04:21:14 +00:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get the shipping rates for the cart address.
|
|
|
|
|
*/
|
|
|
|
|
public function shipping_rates()
|
|
|
|
|
{
|
2019-02-18 07:30:40 +00:00
|
|
|
return $this->hasMany(CartShippingRateProxy::modelClass());
|
2018-09-26 04:21:14 +00:00
|
|
|
}
|
2018-09-27 07:53:26 +00:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get all of the attributes for the attribute groups.
|
|
|
|
|
*/
|
|
|
|
|
public function getNameAttribute()
|
|
|
|
|
{
|
|
|
|
|
return $this->first_name . ' ' . $this->last_name;
|
|
|
|
|
}
|
2018-09-26 04:21:14 +00:00
|
|
|
}
|