Scaffolded from the Ladill mini/events extraction pattern: multi-file transfers, retention controls, public landing pages, analytics, and Gitea deploy workflow. Co-authored-by: Cursor <cursoragent@cursor.com>
32 lines
625 B
PHP
32 lines
625 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class TransferDownloadEvent extends Model
|
|
{
|
|
protected $fillable = [
|
|
'transfer_id',
|
|
'transfer_file_id',
|
|
'downloaded_at',
|
|
'ip_hash',
|
|
'user_agent',
|
|
];
|
|
|
|
protected $casts = [
|
|
'downloaded_at' => 'datetime',
|
|
];
|
|
|
|
public function transfer(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Transfer::class);
|
|
}
|
|
|
|
public function file(): BelongsTo
|
|
{
|
|
return $this->belongsTo(TransferFile::class, 'transfer_file_id');
|
|
}
|
|
}
|