59 lines
1.2 KiB
PHP
59 lines
1.2 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class WebmailMessage extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
/**
|
|
* @var array<int, string>
|
|
*/
|
|
protected $fillable = [
|
|
'user_id',
|
|
'message_uid',
|
|
'direction',
|
|
'folder',
|
|
'status',
|
|
'from_email',
|
|
'from_name',
|
|
'to_recipients',
|
|
'cc_recipients',
|
|
'bcc_recipients',
|
|
'subject',
|
|
'body',
|
|
'snippet',
|
|
'attachments',
|
|
'metadata',
|
|
'read_at',
|
|
'starred_at',
|
|
'sent_at',
|
|
'received_at',
|
|
];
|
|
|
|
/**
|
|
* @var array<string, string>
|
|
*/
|
|
protected $casts = [
|
|
'to_recipients' => 'array',
|
|
'cc_recipients' => 'array',
|
|
'bcc_recipients' => 'array',
|
|
'attachments' => 'array',
|
|
'metadata' => 'array',
|
|
'read_at' => 'datetime',
|
|
'starred_at' => 'datetime',
|
|
'sent_at' => 'datetime',
|
|
'received_at' => 'datetime',
|
|
];
|
|
|
|
public function user(): BelongsTo
|
|
{
|
|
return $this->belongsTo(User::class);
|
|
}
|
|
} |