Skip to content

Commit

Permalink
Fix array_merge error
Browse files Browse the repository at this point in the history
  • Loading branch information
kasparrosin committed Feb 4, 2021
1 parent f359eff commit af37ead
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.7.1] - 2021-02-04

### Changed

- Fixed an issue when `rulesFor` second parameter was given as a string

## [1.7.0] - 2021-01-28

### Added
Expand Down
2 changes: 2 additions & 0 deletions src/TranslatableFieldMixin.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ public function rulesFor()
throw new Exception("Invalid locale specified ({$locale})");
}

if (!is_array($rules)) $rules = [$rules];

$this->rules['translatable'][$locale] = $rules;
return $this;
};
Expand Down

0 comments on commit af37ead

Please sign in to comment.