35 lines
674 B
PHP
35 lines
674 B
PHP
<?php
|
|
|
|
namespace Modules\Customer\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Customer extends Model
|
|
{
|
|
|
|
protected $table = 'tbl_customers';
|
|
protected $fillable = [
|
|
'first_name',
|
|
'last_name',
|
|
'contact',
|
|
'phone',
|
|
'email',
|
|
'address',
|
|
'company_name',
|
|
'company_pan',
|
|
'company_address',
|
|
'company_contact',
|
|
'company_phone',
|
|
'profile_pic',
|
|
'remarks'
|
|
];
|
|
|
|
public $appends = ['customer_name'];
|
|
|
|
public function getCustomerNameAttribute()
|
|
{
|
|
return $this->last_name ? "{$this->first_name} {$this->last_name}" : $this->first_name;
|
|
}
|
|
|
|
}
|