Files
ladill-meet/app/Models/CalendarConnection.php
isaaccladandCursor 965fb992e9
Deploy Ladill Meet / deploy (push) Failing after 7s
Initial Ladill Meet release.
Phases 0–18: core meetings, webinar, breakouts, team chat, live streaming, town hall, billing, and Ladill Mail calendar wiring.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-30 23:35:29 +00:00

50 lines
1.2 KiB
PHP

<?php
namespace App\Models;
use App\Models\Concerns\BelongsToOwner;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Support\Str;
class CalendarConnection extends Model
{
use BelongsToOwner;
protected $table = 'meet_calendar_connections';
protected $fillable = [
'uuid', 'owner_ref', 'organization_id', 'user_ref', 'provider',
'access_token', 'refresh_token', 'expires_at', 'calendar_id', 'metadata',
];
protected function casts(): array
{
return [
'expires_at' => 'datetime',
'metadata' => 'array',
'access_token' => 'encrypted',
'refresh_token' => 'encrypted',
];
}
protected static function booted(): void
{
static::creating(function (CalendarConnection $connection) {
if (empty($connection->uuid)) {
$connection->uuid = (string) Str::uuid();
}
});
}
public function organization(): BelongsTo
{
return $this->belongsTo(Organization::class, 'organization_id');
}
public function isExpired(): bool
{
return $this->expires_at !== null && $this->expires_at->isPast();
}
}