Skip to content

Commit

Permalink
Set column visibility by argument (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
webard authored Jan 6, 2024
1 parent 83ff253 commit ea813df
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ColumnTogglerServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ class ColumnTogglerServiceProvider extends ServiceProvider
{
public function boot(): void
{
Field::macro('hideByDefault', function () {
return $this->withMeta([ 'columnToggleVisible' => false ]);
Field::macro('hideByDefault', function ($hiddenByDefault = true) {
return $this->withMeta([ 'columnToggleVisible' => !$hiddenByDefault ]);
});

Nova::serving(function (ServingNova $event): void {
Expand Down

0 comments on commit ea813df

Please sign in to comment.