Initial Commit
linter / quality (push) Canceled after 0s
tests / ci (8.3) (push) Canceled after 0s
tests / ci (8.4) (push) Canceled after 0s
tests / ci (8.5) (push) Canceled after 0s

This commit is contained in:
2026-08-28 21:50:26 +10:00
commit d8d4ecbe8a
142 changed files with 25234 additions and 0 deletions
+40
View File
@@ -0,0 +1,40 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;
class DirectThread extends Model
{
protected $table = 'dm_threads';
protected $primaryKey = 'thread_id';
public $incrementing = false;
protected $keyType = 'string';
public $timestamps = false;
protected $fillable = [
'thread_id', 'thread_key', 'thread_title', 'is_group',
'participants', 'last_activity_at', 'muted',
];
protected $casts = [
'participants' => 'array',
'is_group' => 'boolean',
'muted' => 'boolean',
'last_activity_at' => 'integer',
'scraped_at' => 'datetime',
];
public function messages(): HasMany
{
return $this->hasMany(DirectMessage::class, 'thread_id', 'thread_id');
}
public function getLastActivityAtDateAttribute(): ?\Carbon\Carbon
{
return $this->last_activity_at
? \Carbon\Carbon::createFromTimestampMs($this->last_activity_at)
: null;
}
}