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

39 lines
940 B
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
{
public function title()
{
if ($this->title) {
return $this->title;
}
return '<i class="feather icon-package grid-action-icon"></i> '.__('admin_message.actions.grid.create_order_package').' &nbsp;&nbsp;';
}
/**
* @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());
}
}