6
0
Fork 0
jiqu-library-server/app/Admin/Actions/Grid/OrderPackageEdit.php

39 lines
921 B
PHP

<?php
namespace App\Admin\Actions\Grid;
use App\Admin\Forms\OrderPackageEdit as OrderPackageEditForm;
use Dcat\Admin\Grid\RowAction;
use Dcat\Admin\Widgets\Modal;
class OrderPackageEdit extends RowAction
{
public function title()
{
if ($this->title) {
return $this->title;
}
return '<i class="feather grid-action-icon icon-shuffle"></i> 修改数量&nbsp;&nbsp;';
}
/**
* @param Model|Authenticatable|HasPermissions|null $user
*
* @return bool
*/
protected function authorize($user): bool
{
return $user->can('dcat.admin.order_packages.edit_custom');
}
public function render()
{
$form = OrderPackageEditForm::make()->payload(['id'=>$this->getKey()]);
return Modal::make()
->lg()
->title($this->title())
->body($form)
->button($this->title());
}
}