3

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

enter image description here

Laravel Nova Resource

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),
    }
}
KSS
  • 337
  • 3
  • 10

1 Answers1

4

There are no conditionals in the Nova source to show / hide that button.

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:

[dusk="update-and-continue-editing-button"] {
    display: none 
}
Brian Dillingham
  • 9,118
  • 3
  • 28
  • 47
  • 1
    Thanks Brian, this worked great and using similar selectors I was able to hide some of the other buttons. – KSS Jun 21 '20 at 13:55
  • Or specify it with: ` button[dusk="update-and-continue-editing-button"] { display: none; } ` – Andreas Ek Jan 26 '21 at 11:19