45 lines
1012 B
PHP
45 lines
1012 B
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
|
|
{
|
|
public function title()
|
|
{
|
|
if ($this->title) {
|
|
return $this->title;
|
|
}
|
|
return '<i class="feather grid-action-icon icon-list"></i> '.__('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()]));
|
|
}
|
|
}
|