32 lines
		
	
	
		
			647 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			32 lines
		
	
	
		
			647 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',
 | 
						|
        'color_fg',
 | 
						|
        'created_at',
 | 
						|
        'edited_at',
 | 
						|
    ];
 | 
						|
 | 
						|
    protected $casts = [
 | 
						|
        'settings' => 'array',
 | 
						|
    ];
 | 
						|
 | 
						|
    public function calendar(): BelongsTo
 | 
						|
    {
 | 
						|
        return $this->belongsTo(Calendar::class, 'calendar_id');
 | 
						|
    }
 | 
						|
}
 |