<?php

namespace App\Admin\Renderable\User;

use App\Models\User;
use Encore\Admin\Widgets\Table;
use Illuminate\Contracts\Support\Renderable;

class ServerKey implements Renderable
{

    public function render($key = null)
    {
        $user = User::find($key);

        $data = [
            [
                '服务秘钥', $user->server_key ?? '---',
            ],
            [
                'DES3秘钥', $user->des3key ?? '---',
            ],
        ];

        $table = new Table(['名称', '参数'], $data);

        return $table->render();
    }

}