diff --git a/src/NovaTabTranslatable.php b/src/NovaTabTranslatable.php index 6aeaf10..4238968 100644 --- a/src/NovaTabTranslatable.php +++ b/src/NovaTabTranslatable.php @@ -86,7 +86,7 @@ public function saveLastSelectedLang(bool $state = true): self ]); } - protected function createTranslatableFields() + protected function createTranslatableFields(): void { collect($this->locales) ->crossJoin($this->originalFields) @@ -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'); @@ -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 => []]; @@ -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'); @@ -291,7 +291,7 @@ public function getUpdateRules(NovaRequest $request) ); } - public function getRules(NovaRequest $request) + public function getRules(NovaRequest $request): array { return $this->getSituationalRulesSet($request); }