17 lines
339 B
PHP
17 lines
339 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace App\Models;
|
||
|
|
|
||
|
|
use Illuminate\Database\Eloquent\Model;
|
||
|
|
|
||
|
|
class Contacts extends Model
|
||
|
|
{
|
||
|
|
public $incrementing = false;
|
||
|
|
protected $appends = ['owner_name'];
|
||
|
|
|
||
|
|
public function getOwnerNameAttribute() {
|
||
|
|
$owner = AppUsers::find($this->user_id);
|
||
|
|
return $owner->surname . " " . $owner->firstname;
|
||
|
|
}
|
||
|
|
}
|