Skip to content

Commit

Permalink
Update NovaTabTranslatable.php Nova 5
Browse files Browse the repository at this point in the history
  • Loading branch information
maul75 authored Dec 16, 2024
1 parent 9abb502 commit 3bca5cc
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/NovaTabTranslatable.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public function saveLastSelectedLang(bool $state = true): self
]);
}

protected function createTranslatableFields()
protected function createTranslatableFields(): void
{
collect($this->locales)
->crossJoin($this->originalFields)
Expand Down Expand Up @@ -244,21 +244,21 @@ protected function compatibilityWithOtherPlugins($translatedField)
return $translatedField;
}

public function resolve($resource, $attribute = null)
public function resolve($resource, $attribute = null): void
{
foreach ($this->data as $field) {
$field->resolve($resource, $attribute);
}
}

public function fillInto($request, $model, $attribute, $requestAttribute = null)
public function fillInto($request, $model, $attribute, $requestAttribute = null): void
{
foreach ($this->data as $field) {
$field->fill($request, $model);
}
}

public function getCreationRules(NovaRequest $request)
public function getCreationRules(NovaRequest $request): array
{
$fieldsRules = $this->getSituationalRulesSet($request, 'creationRules');

Expand All @@ -268,7 +268,7 @@ public function getCreationRules(NovaRequest $request)
);
}

protected function getSituationalRulesSet(NovaRequest $request, string $propertyName = 'rules')
protected function getSituationalRulesSet(NovaRequest $request, string $propertyName = 'rules'): array
{
$fieldsRules = [$this->attribute => []];

Expand All @@ -281,7 +281,7 @@ protected function getSituationalRulesSet(NovaRequest $request, string $property
return $fieldsRules;
}

public function getUpdateRules(NovaRequest $request)
public function getUpdateRules(NovaRequest $request): array
{
$fieldsRules = $this->getSituationalRulesSet($request, 'updateRules');

Expand All @@ -291,7 +291,7 @@ public function getUpdateRules(NovaRequest $request)
);
}

public function getRules(NovaRequest $request)
public function getRules(NovaRequest $request): array
{
return $this->getSituationalRulesSet($request);
}
Expand Down

0 comments on commit 3bca5cc

Please sign in to comment.