24 lines
533 B
PHP
24 lines
533 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
|
use Illuminate\Database\Eloquent\Relations\HasOne;
|
|
|
|
class AddressBook extends Model
|
|
{
|
|
protected $table = 'addressbooks'; // Sabre table
|
|
public $timestamps = false;
|
|
|
|
public function contacts(): HasMany
|
|
{
|
|
return $this->hasMany(Contact::class, 'addressbookid');
|
|
}
|
|
|
|
public function meta(): HasOne
|
|
{
|
|
return $this->hasOne(AddressbookMeta::class, 'addressbook_id');
|
|
}
|
|
}
|