25 lines
558 B
PHP
25 lines
558 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
use Illuminate\Database\Eloquent\Relations\HasOne;
|
|
|
|
class Contact extends Model
|
|
{
|
|
protected $table = 'cards'; // Sabre table
|
|
public $timestamps = false;
|
|
protected $primaryKey = 'id';
|
|
|
|
public function addressBook(): BelongsTo
|
|
{
|
|
return $this->belongsTo(AddressBook::class, 'addressbookid');
|
|
}
|
|
|
|
public function meta(): HasOne
|
|
{
|
|
return $this->hasOne(ContactMeta::class, 'card_id');
|
|
}
|
|
}
|