kithkin/app/Models/CalendarMeta.php

31 lines
627 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class CalendarMeta extends Model
{
protected $table = 'calendar_meta';
protected $primaryKey = 'calendar_id';
public $incrementing = false;
/* add mass-assignment for these cols */
protected $fillable = [
'calendar_id',
'color',
'created_at',
'edited_at',
];
protected $casts = [
'settings' => 'array',
];
public function calendar(): BelongsTo
{
return $this->belongsTo(Calendar::class, 'calendar_id');
}
}