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;
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