ldc-com-app-bo/app/Models/Contacts.php
Vincent BRIDIER f01e1501b4 init
2021-01-15 14:47:59 +01:00

16 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;
}
}