<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

class BookMeta extends Model
{
    protected $table = 'addressbook_meta';
    protected $primaryKey = 'addressbook_id';
    public $incrementing = false;

    protected $fillable = [
        'color',
        'is_default',
        'settings',
    ];

    protected $casts = [
        'settings'   => 'array',
        'is_default' => 'boolean',
    ];

    public function addressBook(): BelongsTo
    {
        return $this->belongsTo(Book::class, 'addressbook_id');
    }
}
