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;
|
|
|
|
|
use Webkul\Customer\Models\Customer;
|
|
|
|
|
|
|
|
|
|
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'];
|
|
|
|
|
|
2018-09-28 12:54:26 +00:00
|
|
|
/**
|
|
|
|
|
* Get of the customer fullname.
|
|
|
|
|
*/
|
|
|
|
|
public function getNameAttribute()
|
|
|
|
|
{
|
|
|
|
|
return $this->first_name . ' ' . $this->last_name;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get the customer record associated with the order.
|
|
|
|
|
*/
|
|
|
|
|
public function customer()
|
|
|
|
|
{
|
|
|
|
|
return $this->belongsTo(Customer::class);
|
|
|
|
|
}
|
|
|
|
|
}
|