Files
ladill-meet/app/Models/ChannelMessage.php
T
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\Database\Eloquent\Relations\HasMany;
use Illuminate\Support\Str;
class ChannelMessage extends Model
{
use BelongsToOwner;
protected $table = 'meet_channel_messages';
protected $fillable = [
'uuid', 'owner_ref', 'channel_id', 'sender_ref', 'sender_name', 'body', 'parent_id', 'metadata',
];
protected function casts(): array
{
return ['metadata' => 'array'];
}
protected static function booted(): void
{
static::creating(function (ChannelMessage $message) {
if (empty($message->uuid)) {
$message->uuid = (string) Str::uuid();
}
});
}
public function channel(): BelongsTo
{
return $this->belongsTo(Channel::class, 'channel_id');
}
public function parent(): BelongsTo
{
return $this->belongsTo(ChannelMessage::class, 'parent_id');
}
public function replies(): HasMany
{
return $this->hasMany(ChannelMessage::class, 'parent_id');
}
}