Модели для конструктора отчетов

This commit is contained in:
brusnitsyn
2026-06-22 16:58:50 +09:00
parent e646ded338
commit 71bd4b9d1a
6 changed files with 174 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
<?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');
}
}