Модели для конструктора отчетов
This commit is contained in:
32
app/Models/ReportDocument.php
Normal file
32
app/Models/ReportDocument.php
Normal 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');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user