32 lines
716 B
PHP
32 lines
716 B
PHP
<?php
|
|
|
|
namespace App\Admin\Actions\Grid;
|
|
|
|
use App\Admin\Forms\PointChange as PointChangeForm;
|
|
use Dcat\Admin\Grid\RowAction;
|
|
use Dcat\Admin\Widgets\Modal;
|
|
|
|
class PointChange extends RowAction
|
|
{
|
|
public function title()
|
|
{
|
|
return '<i class="feather grid-action-icon icon-credit-card"></i> 变更积分';
|
|
}
|
|
|
|
protected function authorize($user): bool
|
|
{
|
|
return $user->can('dcat.admin.users.change_points');
|
|
}
|
|
|
|
public function render()
|
|
{
|
|
$form = PointChangeForm::make()->payload(['id'=>$this->getKey()]);
|
|
|
|
return Modal::make()
|
|
->lg()
|
|
->title($this->title())
|
|
->body($form)
|
|
->button($this->title());
|
|
}
|
|
}
|