26 lines
584 B
PHP
26 lines
584 B
PHP
<?php
|
|
|
|
namespace App\Admin\Renderable\Activity;
|
|
|
|
use App\Models\Activity;
|
|
use Encore\Admin\Widgets\Table;
|
|
use Illuminate\Contracts\Support\Renderable;
|
|
|
|
class Grants implements Renderable
|
|
{
|
|
|
|
public function render($key = null)
|
|
{
|
|
$activity = Activity::find($key);
|
|
$items = $activity->grants->map(function ($info) {
|
|
return [
|
|
'id' => $info->id,
|
|
'nickname' => $info->user_nickname,
|
|
];
|
|
});
|
|
dd($items->toArray());
|
|
|
|
return new Table(['Id', '渠道'], $items->toArray());
|
|
}
|
|
|
|
} |