diff --git a/README.md b/README.md index 416cb4e..47ba7f3 100644 --- a/README.md +++ b/README.md @@ -64,12 +64,9 @@ public function fields(NovaRequest $request) ->min(0.01) ->max(1) ->step(0.01) - ->hideFromIndex() - ->hideFromDetail(), + ->onlyOnForms(), FieldProgressbar::make(__('Score'), 'score') - ->hideWhenUpdating() - ->hideWhenCreating() ->sortable(), ]; } diff --git a/src/FieldProgressbar.php b/src/FieldProgressbar.php index 12d08dd..b97d1f7 100644 --- a/src/FieldProgressbar.php +++ b/src/FieldProgressbar.php @@ -6,6 +6,20 @@ class FieldProgressbar extends Field { + /** + * Indicates if the element should be shown on the update view. + * + * @var (callable(\Laravel\Nova\Http\Requests\NovaRequest, mixed):bool)|bool + */ + public $showOnUpdate = false; + + /** + * Indicates if the element should be shown on the creation view. + * + * @var (callable(\Laravel\Nova\Http\Requests\NovaRequest):bool)|bool + */ + public $showOnCreation = true; + /** * The field's component. *