Files
pingan_new/app/Admin/Renderable/Log/InData.php
2020-10-20 08:34:40 +08:00

32 lines
732 B
PHP

<?php
namespace App\Admin\Renderable\Log;
use App\Models\Log;
use Encore\Admin\Widgets\Table;
use Illuminate\Contracts\Support\Renderable;
class InData implements Renderable
{
public function render($key = null)
{
$log = Log::find($key);
$in_source = $log->in_source;
foreach ($in_source as $key => $item) {
if (!in_array($key, [])) {
}
if (is_array($item)) {
$in_source[$key] = json_encode($item);
}
}
if (is_array($in_source) && count($in_source) > 1) {
$table = new Table(['名称', '值'], $in_source, ['panel', ' panel-default']);
return $table->render();
}
}
}