33 lines
782 B
PHP
33 lines
782 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
/**
|
|
* Сохранённый отчёт конструктора: источник данных + конфигурация
|
|
* (измерения, показатели, фильтры, режим, детализация, настройки графика).
|
|
*/
|
|
class ReportDocument extends Model
|
|
{
|
|
protected $fillable = [
|
|
'name',
|
|
'description',
|
|
'dataset',
|
|
'config',
|
|
'period',
|
|
'created_by',
|
|
];
|
|
|
|
protected $casts = [
|
|
'config' => 'array',
|
|
'period' => 'array',
|
|
];
|
|
|
|
public function creator(): BelongsTo
|
|
{
|
|
return $this->belongsTo(User::class, 'created_by');
|
|
}
|
|
}
|