From 95f56a04d3fdf79c23f852e76bcb4726237c5bfa Mon Sep 17 00:00:00 2001 From: stasbilay02 Date: Fri, 26 Jul 2024 17:32:41 +0300 Subject: [PATCH] post beta fix --- kernel/IGTabel/ViewJsonTableEloquentModel.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/kernel/IGTabel/ViewJsonTableEloquentModel.php b/kernel/IGTabel/ViewJsonTableEloquentModel.php index 07a0a96..6d1e3d4 100644 --- a/kernel/IGTabel/ViewJsonTableEloquentModel.php +++ b/kernel/IGTabel/ViewJsonTableEloquentModel.php @@ -3,6 +3,7 @@ namespace kernel\IGTabel; use app\helpers\Debug; +use app\models\User; use Illuminate\Database\Eloquent\Model; class ViewJsonTableEloquentModel @@ -18,7 +19,14 @@ class ViewJsonTableEloquentModel $this->meta['params'] = $params['params'] ?? []; $this->meta['actions'] = $params['actions'] ?? []; - $this->jsonStr = (new JSONCreator($this->meta, $model->toArray()))->getJson(); +// $this->jsonStr = (new JSONCreator($this->meta, $model->toArray()))->getJson(); + $model = $model->toArray(); + if(isset($model['user_id'])) + { + $model['user_id'] = User::find($model['user_id'])->username; + } + + $this->jsonStr = (new JSONCreator($this->meta, $model))->getJson(); } public function getJson(): ?string