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

45 lines
1.0 KiB
PHP

<?php
namespace App\Admin\Actions\Grid;
use App\Admin\Forms\OrderPackage;
use Dcat\Admin\Grid\RowAction;
use Dcat\Admin\Widgets\Modal;
class CreateOrderPackage extends RowAction
{
/**
* @return string
*/
protected $title = '<i class="feather icon-package grid-action-icon"></i>';
public function title()
{
if ($this->title) {
return $this->title.'&nbsp;'.__('admin_message.actions.grid.craete_order_package');
}
return __('admin_message.actions.grid.create_order_package');
}
/**
* @param Model|Authenticatable|HasPermissions|null $user
*
* @return bool
*/
protected function authorize($user): bool
{
return $user->can('dcat.admin.product_sku_verifies.verify');
}
public function render()
{
$form = OrderPackage::make()->payload(['order_id'=>$this->getKey()]);
return Modal::make()
->lg()
->title($this->title())
->body($form)
->button($this->title());
}
}