post beta fix

This commit is contained in:
Билай Станислав 2024-07-26 17:32:41 +03:00
parent 89b127fd72
commit 95f56a04d3

View File

@ -3,6 +3,7 @@
namespace kernel\IGTabel; namespace kernel\IGTabel;
use app\helpers\Debug; use app\helpers\Debug;
use app\models\User;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;
class ViewJsonTableEloquentModel class ViewJsonTableEloquentModel
@ -18,7 +19,14 @@ class ViewJsonTableEloquentModel
$this->meta['params'] = $params['params'] ?? []; $this->meta['params'] = $params['params'] ?? [];
$this->meta['actions'] = $params['actions'] ?? []; $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 public function getJson(): ?string