[英]Laravel Nova 3 - Resource - Remove Button - “Update & Continue Editing”
I cannot find where to remove one of the buttons on the edit Resource page.我找不到在编辑资源页面上删除其中一个按钮的位置。
The button I want to remove is the one labeled:我要删除的按钮是标记为:
Update & Continue Editing更新并继续编辑
Laravel Nova Resource Laravel 新星资源
class VehicleService extends Resource
{
public static $model = \App\Models\VehicleService::class;
public function fields(Request $request)
{
return [
];
}
public function fieldsForIndex(NovaRequest $request)
{
return [
BelongsTo::make('Vehicle', 'vehicle', 'App\Nova\Vehicle')
->rules('required')
->viewable(false),
];
}
public function fieldsForDetail(NovaRequest $request)
{
BelongsTo::make('Vehicle', 'vehicle', 'App\Nova\Vehicle')
->viewable(false),
}
}
There are no conditionals in the Nova source to show / hide that button. Nova 源中没有条件来显示/隐藏该按钮。
But there are dusk attributes for test purposes that you can hook onto.但是您可以使用黄昏属性进行测试。
Adding a custom nova theme will include a css file you can add this too:添加自定义 nova 主题将包含 css 文件,您也可以添加:
[dusk="update-and-continue-editing-button"] {
display: none
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.