在 lense laravel nova 中隐藏动作
hide actions in lense laravel nova
如何隐藏 lense 页面中的操作我的资源中有以下操作
public function actions(Request $request)
{
return [
(new AddNewURL)
->canSee(function () use ($request) { return $request->user()->hasPermission('updatedOrders-create');})
->canRun(function () use ($request) { return $request->user()->hasPermission('updatedOrders-create');})
->withoutConfirmation(),
(new EditNewURL)
->canSee(function () use ($request) { return $request->user()->hasPermission('updatedOrders-update-all');})
->canRun(function () use ($request) { return $request->user()->hasPermission('updatedOrders-update-all');})
->withoutConfirmation(),
(new PrintBillings)
->withoutConfirmation()
->canSee(function () use ($request) { return $request->user()->hasPermission('orders-actions-print');})
->canRun(function () use ($request) { return $request->user()->hasPermission('orders-actions-print');}),
(new DownloadExcel)
->onlyOnIndex()
->withoutConfirmation(),
];
}
我想将它们隐藏在我已经尝试过的 lense 页面中
public function actions(Request $request)
{
return [];
}
在镜头 class 但没有用,我也完全删除了 actions 方法但它没有用。另外,我试过 ->canSee(function () { return false;})
但它不起作用 !!!!
无法覆盖 table 行中显示的操作,但可以通过覆盖 action[=16= 来覆盖索引右上角显示的操作] 镜头上的方法。
public function actions(Request $request)
{
return [];
}
在这种情况下,索引中显示的所有操作都将消失
如何隐藏 lense 页面中的操作我的资源中有以下操作
public function actions(Request $request)
{
return [
(new AddNewURL)
->canSee(function () use ($request) { return $request->user()->hasPermission('updatedOrders-create');})
->canRun(function () use ($request) { return $request->user()->hasPermission('updatedOrders-create');})
->withoutConfirmation(),
(new EditNewURL)
->canSee(function () use ($request) { return $request->user()->hasPermission('updatedOrders-update-all');})
->canRun(function () use ($request) { return $request->user()->hasPermission('updatedOrders-update-all');})
->withoutConfirmation(),
(new PrintBillings)
->withoutConfirmation()
->canSee(function () use ($request) { return $request->user()->hasPermission('orders-actions-print');})
->canRun(function () use ($request) { return $request->user()->hasPermission('orders-actions-print');}),
(new DownloadExcel)
->onlyOnIndex()
->withoutConfirmation(),
];
}
我想将它们隐藏在我已经尝试过的 lense 页面中
public function actions(Request $request)
{
return [];
}
在镜头 class 但没有用,我也完全删除了 actions 方法但它没有用。另外,我试过 ->canSee(function () { return false;})
但它不起作用 !!!!
无法覆盖 table 行中显示的操作,但可以通过覆盖 action[=16= 来覆盖索引右上角显示的操作] 镜头上的方法。
public function actions(Request $request)
{
return [];
}
在这种情况下,索引中显示的所有操作都将消失