51 lines
1.1 KiB
PHP
51 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Admin\Actions\Grid;
|
|
|
|
use Dcat\Admin\Actions\Response;
|
|
use Dcat\Admin\Grid\RowAction;
|
|
use Illuminate\Http\Request;
|
|
|
|
class SkuList extends RowAction
|
|
{
|
|
/**
|
|
* @return string
|
|
*/
|
|
protected $title = '<i class="feather icon-list grid-action-icon"></i>';
|
|
|
|
public function title()
|
|
{
|
|
if ($this->title) {
|
|
return $this->title.' '.__('admin.list');
|
|
}
|
|
|
|
return __('admin.list');
|
|
}
|
|
|
|
/**
|
|
* @param Model|Authenticatable|HasPermissions|null $user
|
|
*
|
|
* @return bool
|
|
*/
|
|
protected function authorize($user): bool
|
|
{
|
|
return $user->can('dcat.admin.product_skus.index');
|
|
}
|
|
|
|
/**
|
|
* Handle the action request.
|
|
*
|
|
* @param Request $request
|
|
*
|
|
* @return Response
|
|
*/
|
|
public function handle(Request $request)
|
|
{
|
|
// dump($this->getKey());
|
|
|
|
return $this->response()
|
|
// ->success('Processed successfully: '.$this->getKey())
|
|
->redirect(admin_route('product_spus.sku_list', ['spu' =>$this->getKey()]));
|
|
}
|
|
}
|