2018-09-28 12:54:26 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace Webkul\Sales\Models;
|
|
|
|
|
|
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
|
use Webkul\Sales\Contracts\OrderAddress as OrderAddressContract;
|
|
|
|
|
|
|
|
|
|
class OrderAddress extends Model implements OrderAddressContract
|
|
|
|
|
{
|
|
|
|
|
protected $table = 'order_address';
|
|
|
|
|
|
2018-10-05 06:18:58 +00:00
|
|
|
protected $guarded = ['id', 'created_at', 'updated_at'];
|
|
|
|
|
|
2020-02-26 06:37:17 +00:00
|
|
|
protected $fillable = [
|
|
|
|
|
'first_name',
|
|
|
|
|
'last_name',
|
|
|
|
|
'email',
|
|
|
|
|
'company_name',
|
|
|
|
|
'vat_id',
|
|
|
|
|
'address1',
|
|
|
|
|
'address2',
|
|
|
|
|
'city',
|
|
|
|
|
'state',
|
|
|
|
|
'postcode',
|
|
|
|
|
'country',
|
|
|
|
|
'phone',
|
|
|
|
|
'address_type',
|
|
|
|
|
'cart_id',
|
|
|
|
|
'customer_id',
|
|
|
|
|
];
|
|
|
|
|
|
2018-09-28 12:54:26 +00:00
|
|
|
/**
|
|
|
|
|
* Get of the customer fullname.
|
|
|
|
|
*/
|
|
|
|
|
public function getNameAttribute()
|
|
|
|
|
{
|
|
|
|
|
return $this->first_name . ' ' . $this->last_name;
|
|
|
|
|
}
|
2018-10-15 08:22:27 +00:00
|
|
|
|
2018-09-28 12:54:26 +00:00
|
|
|
/**
|
|
|
|
|
* Get the customer record associated with the order.
|
|
|
|
|
*/
|
|
|
|
|
public function customer()
|
|
|
|
|
{
|
|
|
|
|
return $this->belongsTo(Customer::class);
|
|
|
|
|
}
|
|
|
|
|
}
|