kithkin/app/Models/Subscription.php

43 lines
961 B
PHP

<?php
namespace App\Models;
use App\Models\CalendarMeta;
use App\Models\User;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Str;
class Subscription extends Model
{
/** basic table mapping */
protected $table = 'calendarsubscriptions';
public $timestamps = false; // sabre table
protected $fillable = [
'uri',
'principaluri',
'source',
'displayname',
'calendarcolor',
'refreshrate',
'calendarorder',
'striptodos',
'stripalarms',
'stripattachments',
];
protected $casts = [
'striptodos' => 'bool',
'stripalarms' => 'bool',
'stripattachments' => 'bool',
];
/** relationship to meta row */
public function meta()
{
return $this->hasOne(\App\Models\CalendarMeta::class,
'subscription_id');
}
}