orchidsoftware / crud

Simplify the process of building CRUD (Create, Read, Update, Delete) functionality in Laravel using the features of Orchid.
https://orchid.software
MIT License
137 stars 34 forks source link

The value of Button in form is being overwritten #59

Open ajaxray opened 2 years ago

ajaxray commented 2 years ago

I am trying to add a submit button at the end of the form.

public function fields(): array
    {
        return [
            // other fields ...
            Button::make($this::updateButtonLabel())
                ->class('btn btn-primary')->method('update')
        ];
    }

The button is being added and seems to be working.

But the problem is, the button value is being overwritten and becoming model[Update ResourceName].

CleanShot 2021-12-19 at 15 58 26@2x

How can I avoid this and keep the button name as is? Can anyone help?

gioacchinopoletto commented 1 year ago

You can add a language string like:

Update ResourceName: new string

for example:

"Update ResourceName": "Update record"