fix JSON creator
This commit is contained in:
parent
cba0498e7d
commit
850b0b315a
@ -50,7 +50,7 @@ class EloquentDataProvider
|
|||||||
$this->meta['actions'] = $options['actions'] ?? [];
|
$this->meta['actions'] = $options['actions'] ?? [];
|
||||||
$this->filters = $options['filters'] ?? [];
|
$this->filters = $options['filters'] ?? [];
|
||||||
$this->createQuery();
|
$this->createQuery();
|
||||||
$this->jsonStr = (new JSONCreator($this->meta, $this->filters, $this->getCollection()->toArray()))->getJson();
|
$this->jsonStr = (new JSONCreator($this->meta, $this->getCollection()->toArray(), $this->filters,))->getJson();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function createQuery(): void
|
public function createQuery(): void
|
||||||
|
@ -7,7 +7,7 @@ class JSONCreator
|
|||||||
{
|
{
|
||||||
protected array $informationArray = [];
|
protected array $informationArray = [];
|
||||||
|
|
||||||
public function __construct(array $meta, array $filters, array $data)
|
public function __construct(array $meta, array $data, array $filters = [])
|
||||||
{
|
{
|
||||||
$params = empty($meta['params']) ? ["class" => "table table-bordered", "border" => "1"] : $meta['params'];
|
$params = empty($meta['params']) ? ["class" => "table table-bordered", "border" => "1"] : $meta['params'];
|
||||||
if ($meta) {
|
if ($meta) {
|
||||||
@ -27,7 +27,6 @@ class JSONCreator
|
|||||||
{
|
{
|
||||||
if ($infArr)
|
if ($infArr)
|
||||||
return json_encode($infArr, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE);
|
return json_encode($infArr, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE);
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user