36 lines
747 B
PHP
36 lines
747 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class ExportLog extends Model
|
|
{
|
|
protected $guarded = [];
|
|
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'generated_at' => 'datetime',
|
|
'filter_parameters' => 'array',
|
|
'purged_at' => 'datetime',
|
|
];
|
|
}
|
|
|
|
public function election(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Election::class);
|
|
}
|
|
|
|
public function generatedBy(): BelongsTo
|
|
{
|
|
return $this->belongsTo(User::class, 'generated_by_user_id');
|
|
}
|
|
|
|
public function purgedBy(): BelongsTo
|
|
{
|
|
return $this->belongsTo(User::class, 'purged_by_user_id');
|
|
}
|
|
}
|