Search code examples
phplaravellaravel-nova

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

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),
    }
}

Solution

  • 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 
    }