Skip to content

Commit

Permalink
Support Nova authorizedToSee method
Browse files Browse the repository at this point in the history
  • Loading branch information
kongulov authored Feb 1, 2021
1 parent 7f0ae2c commit dae019a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/NovaTabTranslatable.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,12 @@ protected function createTranslatableFields()
collect($this->locales)
->crossJoin($this->originalFields)
->eachSpread(function (string $locale, Field $field) {
$translatedField = $this->createTranslatedField($field, $locale);
if($field->authorizedToSee(request())) {
$translatedField = $this->createTranslatedField($field, $locale);

$this->data[] = $translatedField;
$this->translatedFieldsByLocale[$locale][] = $translatedField;
$this->data[] = $translatedField;
$this->translatedFieldsByLocale[$locale][] = $translatedField;
}
});
}

Expand Down

0 comments on commit dae019a

Please sign in to comment.