[新增] first commit
This commit is contained in:
26
app/Admin/Renderable/Activity/Grants.php
Normal file
26
app/Admin/Renderable/Activity/Grants.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?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());
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user