Skip to content

Commit d7d2534

Browse files
authored
Merge pull request #2 from Muetze42/main
Automatic hide on forms
2 parents 0f6daf0 + 510bbfa commit d7d2534

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

README.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,9 @@ public function fields(NovaRequest $request)
6464
->min(0.01)
6565
->max(1)
6666
->step(0.01)
67-
->hideFromIndex()
68-
->hideFromDetail(),
67+
->onlyOnForms(),
6968

7069
FieldProgressbar::make(__('Score'), 'score')
71-
->hideWhenUpdating()
72-
->hideWhenCreating()
7370
->sortable(),
7471
];
7572
}

src/FieldProgressbar.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,20 @@
66

77
class FieldProgressbar extends Field
88
{
9+
/**
10+
* Indicates if the element should be shown on the update view.
11+
*
12+
* @var (callable(\Laravel\Nova\Http\Requests\NovaRequest, mixed):bool)|bool
13+
*/
14+
public $showOnUpdate = false;
15+
16+
/**
17+
* Indicates if the element should be shown on the creation view.
18+
*
19+
* @var (callable(\Laravel\Nova\Http\Requests\NovaRequest):bool)|bool
20+
*/
21+
public $showOnCreation = true;
22+
923
/**
1024
* The field's component.
1125
*

0 commit comments

Comments
 (0)