From b0cb9c46c3444d3b10a2f88b11e1a2ac23147714 Mon Sep 17 00:00:00 2001 From: ARCANEDEV Date: Fri, 7 May 2021 22:02:57 +0000 Subject: [PATCH] Update the package --- .github/workflows/run-tests.yml | 8 +- .scrutinizer.yml | 2 +- _docs/2-Configuration.md | 3 +- composer.json | 15 +- config/laravel-lang.php | 3 +- src/FileLoader.php | 8 +- src/LaravelLang.php | 2 +- src/Providers/DeferredServicesProvider.php | 24 +-- src/TransManager.php | 72 ++++---- tests/TestCase.php | 19 +-- tests/TransManagerTest.php | 5 +- tests/TransPublisherTest.php | 5 + tests/TranslatorTest.php | 4 +- tests/fixtures/lang/en/auth.php | 3 +- tests/fixtures/lang/en/pagination.php | 2 - tests/fixtures/lang/en/passwords.php | 10 +- tests/fixtures/lang/en/validation.php | 182 +++++++++++---------- 17 files changed, 192 insertions(+), 175 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index d1ead4b..012bf19 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -9,7 +9,7 @@ jobs: strategy: fail-fast: true matrix: - php: [7.3, 7.4] + php: [7.3, 7.4, 8.0] dependency-version: [prefer-lowest, prefer-stable] name: PHP ${{ matrix.php }} - ${{ matrix.dependency-version }} @@ -17,6 +17,8 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v2 + with: + fetch-depth: 2 - name: Cache dependencies uses: actions/cache@v2 @@ -41,5 +43,5 @@ jobs: - name: Scrutinizer CI run: | - wget https://scrutinizer-ci.com/ocular.phar - php ocular.phar code-coverage:upload --format=php-clover coverage.clover + composer require scrutinizer/ocular --dev + vendor/bin/ocular code-coverage:upload --format=php-clover coverage.clover diff --git a/.scrutinizer.yml b/.scrutinizer.yml index 69d4755..8a9285f 100644 --- a/.scrutinizer.yml +++ b/.scrutinizer.yml @@ -22,7 +22,7 @@ checks: tools: external_code_coverage: timeout: 600 - runs: 4 + runs: 6 php_code_sniffer: enabled: true config: diff --git a/_docs/2-Configuration.md b/_docs/2-Configuration.md index c3578d6..8f0c4f2 100644 --- a/_docs/2-Configuration.md +++ b/_docs/2-Configuration.md @@ -21,8 +21,7 @@ return [ /** @link https://github.com/Laravel-Lang/lang */ 'vendor' => [ - 'php' => base_path('vendor/laravel-lang/lang/src'), - 'json' => base_path('vendor/laravel-lang/lang/json'), + base_path('vendor/laravel-lang/lang/locales'), ], /* ----------------------------------------------------------------- diff --git a/composer.json b/composer.json index c270ba6..7423314 100644 --- a/composer.json +++ b/composer.json @@ -16,13 +16,15 @@ "type": "library", "license": "MIT", "require": { - "php": "^7.3", + "php": "^7.3|^8.0", "arcanedev/support": "^8.0", - "laravel-lang/lang": "^7.0.1" + "laravel-lang/lang": "^9.0" }, "require-dev": { - "orchestra/testbench": "^6.0", - "phpunit/phpunit": "^9.3" + "laravel/framework": "^8.40", + "mockery/mockery": "^1.4.2", + "orchestra/testbench-core": "^6.4", + "phpunit/phpunit": "^9.3.3" }, "autoload": { "psr-4": { @@ -35,8 +37,9 @@ } }, "scripts": { - "test": "phpunit", - "coverage": "phpunit --coverage-html build/coverage/html" + "test": "phpunit --colors=always", + "test:dox": "phpunit --testdox --colors=always", + "test:cov": "phpunit --coverage-html coverage" }, "extra": { "branch-alias": { diff --git a/config/laravel-lang.php b/config/laravel-lang.php index b36f17a..58b6d9a 100644 --- a/config/laravel-lang.php +++ b/config/laravel-lang.php @@ -9,8 +9,7 @@ /** @link https://github.com/Laravel-Lang/lang */ 'vendor' => [ - 'php' => base_path('vendor/laravel-lang/lang/src'), - 'json' => base_path('vendor/laravel-lang/lang/json'), + base_path('vendor/laravel-lang/lang/locales'), ], /* ----------------------------------------------------------------- diff --git a/src/FileLoader.php b/src/FileLoader.php index 80411aa..5ff102f 100644 --- a/src/FileLoader.php +++ b/src/FileLoader.php @@ -115,8 +115,12 @@ public function load($locale, $group, $namespace = null): array { $defaults = []; - if (empty($this->locales) || $this->isSupported($locale)) - $defaults = $this->loadPath($this->getVendorPaths()['php'], $locale, $group); + if (empty($this->locales) || $this->isSupported($locale)) { + foreach ($this->getVendorPaths() as $path) { + if ( ! empty($defaults = $this->loadPath($path, $locale, $group))) + break; + } + } return array_replace_recursive($defaults, parent::load($locale, $group, $namespace)); } diff --git a/src/LaravelLang.php b/src/LaravelLang.php index dda4088..0537047 100644 --- a/src/LaravelLang.php +++ b/src/LaravelLang.php @@ -16,5 +16,5 @@ class LaravelLang | ----------------------------------------------------------------- */ - const VERSION = '9.0.0'; + const VERSION = '9.1.0'; } diff --git a/src/Providers/DeferredServicesProvider.php b/src/Providers/DeferredServicesProvider.php index f09fffa..4623374 100644 --- a/src/Providers/DeferredServicesProvider.php +++ b/src/Providers/DeferredServicesProvider.php @@ -4,14 +4,13 @@ namespace Arcanedev\LaravelLang\Providers; -use Illuminate\Support\Collection; use Arcanedev\LaravelLang\{TransChecker, TransManager, TransPublisher}; use Arcanedev\LaravelLang\Contracts\TransChecker as TransCheckerContract; use Arcanedev\LaravelLang\Contracts\TransManager as TransManagerContract; use Arcanedev\LaravelLang\Contracts\TransPublisher as TransPublisherContract; use Arcanedev\Support\Providers\ServiceProvider; +use Illuminate\Contracts\Foundation\Application; use Illuminate\Contracts\Support\DeferrableProvider; -use Illuminate\Foundation\Application; /** * Class DeferredServicesProvider @@ -60,7 +59,7 @@ public function provides(): array private function registerTransManager(): void { $this->singleton(TransManagerContract::class, function (Application $app) { - return new TransManager($app['files'], $this->getVendorPaths($app)); + return new TransManager($app['files'], $this->getPaths($app)); }); } @@ -93,22 +92,17 @@ private function registerLangPublisher(): void } /** - * Get the vendor paths. + * Get the localization paths. * - * @param \Illuminate\Foundation\Application $app + * @param \Illuminate\Contracts\Foundation\Application $app * * @return array */ - private function getVendorPaths(Application $app): array + private function getPaths(Application $app): array { - return Collection::make($app['config']->get('laravel-lang.vendor', [])) - ->mapWithKeys(function (string $path, string $group) { - return ["vendor-{$group}" => $path]; - }) - ->put('app', $app->langPath()) - ->transform(function (string $path) { - return realpath($path); - }) - ->toArray(); + return [ + 'app' => $app->langPath(), + 'vendors' => $app['config']->get('laravel-lang.vendor', []), + ]; } } diff --git a/src/TransManager.php b/src/TransManager.php index f54d4ba..479c61d 100644 --- a/src/TransManager.php +++ b/src/TransManager.php @@ -26,7 +26,7 @@ class TransManager implements TransManagerContract * * @var array */ - private $paths = []; + private $paths = []; /** * Translations collection. @@ -96,49 +96,33 @@ public function getPaths(): array */ private function load(): void { - foreach ($this->getPaths() as $group => $path) { - $this->locales[$group] = $group === 'vendor-json' - ? $this->loadJsonDirectory($path) - : $this->loadDirectories($path); - } - } + $paths = $this->getPaths(); - /** - * @param string $path - * - * @return \Arcanedev\LaravelLang\Entities\LocaleCollection - */ - private function loadJsonDirectory(string $path): LocaleCollection - { - $locales = new LocaleCollection; + $this->locales['app'] = $this->loadTranslations($paths['app']); - foreach ($this->filesystem->files($path) as $file) { - $locales->addOne( - new Locale($file->getBasename('.json'), $file->getRealPath()) - ); + foreach ($paths['vendors'] as $path) { + $this->locales['vendor-php'] = $this->loadTranslations($path); + $this->locales['vendor-json'] = $this->loadJsonTranslations($path); } - - return $locales; } /** - * Load directories. + * Load translation files. * * @param string $dirPath * * @return \Arcanedev\LaravelLang\Entities\LocaleCollection */ - private function loadDirectories(string $dirPath): LocaleCollection + private function loadTranslations(string $dirPath): LocaleCollection { $locales = new LocaleCollection; foreach ($this->filesystem->directories($dirPath) as $path) { - if ($this->isExcluded($path)) { + if ($this->isExcluded($path)) continue; - } $locales->addOne( - new Locale(basename($path), $path, $this->loadLocaleFiles($path)) + new Locale(basename($path), $path, $this->loadTranslationFiles($path)) ); } @@ -152,12 +136,14 @@ private function loadDirectories(string $dirPath): LocaleCollection * * @return array */ - private function loadLocaleFiles(string $path): array + private function loadTranslationFiles(string $path): array { $files = []; foreach ($this->filesystem->allFiles($path) as $file) { - /** @var \Symfony\Component\Finder\SplFileInfo $file */ + if ($file->getExtension() !== 'php') + continue; + $key = str_replace( ['.php', DIRECTORY_SEPARATOR], ['', '.'], $file->getRelativePathname() ); @@ -171,6 +157,34 @@ private function loadLocaleFiles(string $path): array return $files; } + /** + * Load json translation files. + * + * @param string $dirPath + * + * @return \Arcanedev\LaravelLang\Entities\LocaleCollection + */ + private function loadJsonTranslations(string $dirPath): LocaleCollection + { + $locales = new LocaleCollection; + + foreach ($this->filesystem->directories($dirPath) as $path) { + if ($this->isExcluded($path)) + continue; + + foreach ($this->filesystem->files($path) as $file) { + if ($file->getExtension() === 'json') { + $locales->addOne( + new Locale($file->getBasename('.json'), $file->getRealPath()) + ); + break; + } + } + } + + return $locales; + } + /** * Get locale collection by group location. * @@ -261,6 +275,6 @@ public function hasCollection(string $group): bool */ private function isExcluded(string $path): bool { - return in_array($key = basename($path), $this->excludedFolders); + return in_array(basename($path), $this->excludedFolders); } } diff --git a/tests/TestCase.php b/tests/TestCase.php index 1a5d344..6d8e0da 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -24,11 +24,11 @@ abstract class TestCase extends BaseTestCase * @var array */ protected $locales = [ - 'ar', 'az', 'be', 'bg', 'bn', 'bs', 'ca', 'cs', 'cy', 'da', 'de', 'de_CH', 'el', 'es', 'et', 'eu', 'fa', 'fi', - 'fil', 'fr', 'gl', 'he', 'hi', 'hr', 'hu', 'hy', 'id', 'is', 'it', 'ja', 'ka', 'kk', 'km', 'kn', 'ko', 'lt', - 'lv', 'me', 'mk', 'mn', 'mr', 'ms', 'nb', 'ne', 'nl', 'nn', 'pl', 'ps', 'pt', 'pt_BR', 'ro', 'ru', 'sc', 'si', - 'sk', 'sl', 'sq', 'sr_Cyrillic', 'sr_Latin', 'sv', 'sw', 'tg', 'th', 'tk', 'tl', 'tr', 'ug', 'uk', 'ur', - 'uz_Cyrillic', 'uz_Latin', 'vi', 'zh_CN', 'zh_HK', 'zh_TW', + 'af', 'ar', 'az', 'be', 'bg', 'bn', 'bs', 'ca', 'cs', 'cy', 'da', 'de', 'de_CH', 'el', 'es', 'et', 'eu', 'fa', + 'fi', 'fil', 'fr', 'gl', 'he', 'hi', 'hr', 'hu', 'hy', 'id', 'is', 'it', 'ja', 'ka', 'kk', 'km', 'kn', 'ko', + 'lt', 'lv', 'mk', 'mn', 'mr', 'ms', 'nb', 'ne', 'nl', 'nn', 'oc', 'pl', 'ps', 'pt', 'pt_BR', 'ro', 'ru', 'sc', + 'si', 'sk', 'sl', 'sq', 'sr_Cyrl', 'sr_Latn', 'sr_Latn_ME', 'sv', 'sw', 'tg', 'th', 'tk', 'tl', 'tr', 'ug', 'uk', + 'ur', 'uz_Cyrl', 'uz_Latn', 'vi', 'zh_CN', 'zh_HK', 'zh_TW', ]; /* ----------------------------------------------------------------- @@ -64,14 +64,13 @@ protected function getEnvironmentSetUp($app): void $config = $app['config']; $config->set('laravel-lang', [ - 'vendor' => [ - 'php' => realpath($basePath . '/vendor/laravel-lang/lang/src'), - 'json' => realpath($basePath . '/vendor/laravel-lang/lang/json'), + 'vendor' => [ + realpath($basePath . '/vendor/laravel-lang/lang/locales'), ], - 'locales' => ['es', 'fr'], + 'locales' => ['es', 'fr'], - 'check' => [ + 'check' => [ 'ignore' => [ 'validation.custom', 'validation.attributes', diff --git a/tests/TransManagerTest.php b/tests/TransManagerTest.php index ec745b2..c22b908 100644 --- a/tests/TransManagerTest.php +++ b/tests/TransManagerTest.php @@ -59,10 +59,9 @@ public function it_can_be_instantiated(): void $paths = $this->manager->getPaths(); - static::assertCount(3, $paths); + static::assertCount(2, $paths); static::assertArrayHasKey('app', $paths); - static::assertArrayHasKey('vendor-php', $paths); - static::assertArrayHasKey('vendor-json', $paths); + static::assertArrayHasKey('vendors', $paths); } /** @test */ diff --git a/tests/TransPublisherTest.php b/tests/TransPublisherTest.php index 993772d..6aed179 100644 --- a/tests/TransPublisherTest.php +++ b/tests/TransPublisherTest.php @@ -66,6 +66,7 @@ public function it_can_publish(): void static::assertEquals([ 'published' => [ 'es/auth.php', + 'es/es.json', 'es/pagination.php', 'es/passwords.php', 'es/validation.php', @@ -79,6 +80,7 @@ public function it_can_publish(): void static::assertEquals([ 'published' => [ 'es/auth.php', + 'es/es.json', 'es/pagination.php', 'es/passwords.php', 'es/validation.php', @@ -98,6 +100,7 @@ public function it_can_not_publish_if_is_not_forced(): void static::assertEquals([ 'published' => [ 'es/auth.php', + 'es/es.json', 'es/pagination.php', 'es/passwords.php', 'es/validation.php', @@ -109,6 +112,7 @@ public function it_can_not_publish_if_is_not_forced(): void 'published' => [], 'skipped' => [ 'es/auth.php', + 'es/es.json', 'es/pagination.php', 'es/passwords.php', 'es/validation.php', @@ -127,6 +131,7 @@ public function it_can_publish_on_force(): void $excepted = [ 'published' => [ 'es/auth.php', + 'es/es.json', 'es/pagination.php', 'es/passwords.php', 'es/validation.php', diff --git a/tests/TranslatorTest.php b/tests/TranslatorTest.php index a5339fa..a185625 100644 --- a/tests/TranslatorTest.php +++ b/tests/TranslatorTest.php @@ -56,10 +56,10 @@ public function it_can_translate(): void { $expectations = [ 'es' => [ - 'auth.failed' => 'Estas credenciales no coinciden con nuestros registros.' + 'auth.failed' => 'Estas credenciales no coinciden con nuestros registros.', ], 'fr' => [ - 'auth.failed' => 'Ces identifiants ne correspondent pas à nos enregistrements' + 'auth.failed' => 'Ces identifiants ne correspondent pas à nos enregistrements.', ], ]; diff --git a/tests/fixtures/lang/en/auth.php b/tests/fixtures/lang/en/auth.php index 6ef1a73..b941612 100644 --- a/tests/fixtures/lang/en/auth.php +++ b/tests/fixtures/lang/en/auth.php @@ -1,7 +1,6 @@ 'These credentials do not match our records.', + 'password' => 'The provided password is incorrect.', 'throttle' => 'Too many login attempts. Please try again in :seconds seconds.', - ]; diff --git a/tests/fixtures/lang/en/pagination.php b/tests/fixtures/lang/en/pagination.php index fcab34b..5123030 100644 --- a/tests/fixtures/lang/en/pagination.php +++ b/tests/fixtures/lang/en/pagination.php @@ -1,7 +1,6 @@ '« Previous', 'next' => 'Next »', - ]; diff --git a/tests/fixtures/lang/en/passwords.php b/tests/fixtures/lang/en/passwords.php index 2345a56..652323e 100644 --- a/tests/fixtures/lang/en/passwords.php +++ b/tests/fixtures/lang/en/passwords.php @@ -1,7 +1,6 @@ 'Your password has been reset!', - 'sent' => 'We have emailed your password reset link!', + 'reset' => 'Your password has been reset!', + 'sent' => 'We have emailed your password reset link!', 'throttled' => 'Please wait before retrying.', - 'token' => 'This password reset token is invalid.', - 'user' => "We can't find a user with that email address.", - + 'token' => 'This password reset token is invalid.', + 'user' => "We can't find a user with that email address.", ]; diff --git a/tests/fixtures/lang/en/validation.php b/tests/fixtures/lang/en/validation.php index a65914f..aab6dc0 100644 --- a/tests/fixtures/lang/en/validation.php +++ b/tests/fixtures/lang/en/validation.php @@ -1,7 +1,6 @@ 'The :attribute must be accepted.', - 'active_url' => 'The :attribute is not a valid URL.', - 'after' => 'The :attribute must be a date after :date.', - 'after_or_equal' => 'The :attribute must be a date after or equal to :date.', - 'alpha' => 'The :attribute may only contain letters.', - 'alpha_dash' => 'The :attribute may only contain letters, numbers, dashes and underscores.', - 'alpha_num' => 'The :attribute may only contain letters and numbers.', - 'array' => 'The :attribute must be an array.', - 'before' => 'The :attribute must be a date before :date.', - 'before_or_equal' => 'The :attribute must be a date before or equal to :date.', - 'between' => [ + 'accepted' => 'The :attribute must be accepted.', + 'active_url' => 'The :attribute is not a valid URL.', + 'after' => 'The :attribute must be a date after :date.', + 'after_or_equal' => 'The :attribute must be a date after or equal to :date.', + 'alpha' => 'The :attribute may only contain letters.', + 'alpha_dash' => 'The :attribute may only contain letters, numbers, dashes and underscores.', + 'alpha_num' => 'The :attribute may only contain letters and numbers.', + 'array' => 'The :attribute must be an array.', + 'attached' => 'This :attribute is already attached.', + 'before' => 'The :attribute must be a date before :date.', + 'before_or_equal' => 'The :attribute must be a date before or equal to :date.', + 'between' => [ 'numeric' => 'The :attribute must be between :min and :max.', - 'file' => 'The :attribute must be between :min and :max kilobytes.', - 'string' => 'The :attribute must be between :min and :max characters.', - 'array' => 'The :attribute must have between :min and :max items.', + 'file' => 'The :attribute must be between :min and :max kilobytes.', + 'string' => 'The :attribute must be between :min and :max characters.', + 'array' => 'The :attribute must have between :min and :max items.', ], - 'boolean' => 'The :attribute field must be true or false.', - 'confirmed' => 'The :attribute confirmation does not match.', - 'date' => 'The :attribute is not a valid date.', - 'date_equals' => 'The :attribute must be a date equal to :date.', - 'date_format' => 'The :attribute does not match the format :format.', - 'different' => 'The :attribute and :other must be different.', - 'digits' => 'The :attribute must be :digits digits.', - 'digits_between' => 'The :attribute must be between :min and :max digits.', - 'dimensions' => 'The :attribute has invalid image dimensions.', - 'distinct' => 'The :attribute field has a duplicate value.', - 'email' => 'The :attribute must be a valid email address.', - 'ends_with' => 'The :attribute must end with one of the following: :values.', - 'exists' => 'The selected :attribute is invalid.', - 'file' => 'The :attribute must be a file.', - 'filled' => 'The :attribute field must have a value.', - 'gt' => [ + 'boolean' => 'The :attribute field must be true or false.', + 'confirmed' => 'The :attribute confirmation does not match.', + 'date' => 'The :attribute is not a valid date.', + 'date_equals' => 'The :attribute must be a date equal to :date.', + 'date_format' => 'The :attribute does not match the format :format.', + 'different' => 'The :attribute and :other must be different.', + 'digits' => 'The :attribute must be :digits digits.', + 'digits_between' => 'The :attribute must be between :min and :max digits.', + 'dimensions' => 'The :attribute has invalid image dimensions.', + 'distinct' => 'The :attribute field has a duplicate value.', + 'email' => 'The :attribute must be a valid email address.', + 'ends_with' => 'The :attribute must end with one of the following: :values.', + 'exists' => 'The selected :attribute is invalid.', + 'file' => 'The :attribute must be a file.', + 'filled' => 'The :attribute field must have a value.', + 'gt' => [ 'numeric' => 'The :attribute must be greater than :value.', - 'file' => 'The :attribute must be greater than :value kilobytes.', - 'string' => 'The :attribute must be greater than :value characters.', - 'array' => 'The :attribute must have more than :value items.', + 'file' => 'The :attribute must be greater than :value kilobytes.', + 'string' => 'The :attribute must be greater than :value characters.', + 'array' => 'The :attribute must have more than :value items.', ], - 'gte' => [ + 'gte' => [ 'numeric' => 'The :attribute must be greater than or equal :value.', - 'file' => 'The :attribute must be greater than or equal :value kilobytes.', - 'string' => 'The :attribute must be greater than or equal :value characters.', - 'array' => 'The :attribute must have :value items or more.', + 'file' => 'The :attribute must be greater than or equal :value kilobytes.', + 'string' => 'The :attribute must be greater than or equal :value characters.', + 'array' => 'The :attribute must have :value items or more.', ], - 'image' => 'The :attribute must be an image.', - 'in' => 'The selected :attribute is invalid.', - 'in_array' => 'The :attribute field does not exist in :other.', - 'integer' => 'The :attribute must be an integer.', - 'ip' => 'The :attribute must be a valid IP address.', - 'ipv4' => 'The :attribute must be a valid IPv4 address.', - 'ipv6' => 'The :attribute must be a valid IPv6 address.', - 'json' => 'The :attribute must be a valid JSON string.', - 'lt' => [ + 'image' => 'The :attribute must be an image.', + 'in' => 'The selected :attribute is invalid.', + 'in_array' => 'The :attribute field does not exist in :other.', + 'integer' => 'The :attribute must be an integer.', + 'ip' => 'The :attribute must be a valid IP address.', + 'ipv4' => 'The :attribute must be a valid IPv4 address.', + 'ipv6' => 'The :attribute must be a valid IPv6 address.', + 'json' => 'The :attribute must be a valid JSON string.', + 'lt' => [ 'numeric' => 'The :attribute must be less than :value.', - 'file' => 'The :attribute must be less than :value kilobytes.', - 'string' => 'The :attribute must be less than :value characters.', - 'array' => 'The :attribute must have less than :value items.', + 'file' => 'The :attribute must be less than :value kilobytes.', + 'string' => 'The :attribute must be less than :value characters.', + 'array' => 'The :attribute must have less than :value items.', ], - 'lte' => [ + 'lte' => [ 'numeric' => 'The :attribute must be less than or equal :value.', - 'file' => 'The :attribute must be less than or equal :value kilobytes.', - 'string' => 'The :attribute must be less than or equal :value characters.', - 'array' => 'The :attribute must not have more than :value items.', + 'file' => 'The :attribute must be less than or equal :value kilobytes.', + 'string' => 'The :attribute must be less than or equal :value characters.', + 'array' => 'The :attribute must not have more than :value items.', ], - 'max' => [ + 'max' => [ 'numeric' => 'The :attribute may not be greater than :max.', - 'file' => 'The :attribute may not be greater than :max kilobytes.', - 'string' => 'The :attribute may not be greater than :max characters.', - 'array' => 'The :attribute may not have more than :max items.', + 'file' => 'The :attribute may not be greater than :max kilobytes.', + 'string' => 'The :attribute may not be greater than :max characters.', + 'array' => 'The :attribute may not have more than :max items.', ], - 'mimes' => 'The :attribute must be a file of type: :values.', - 'mimetypes' => 'The :attribute must be a file of type: :values.', - 'min' => [ + 'mimes' => 'The :attribute must be a file of type: :values.', + 'mimetypes' => 'The :attribute must be a file of type: :values.', + 'min' => [ 'numeric' => 'The :attribute must be at least :min.', - 'file' => 'The :attribute must be at least :min kilobytes.', - 'string' => 'The :attribute must be at least :min characters.', - 'array' => 'The :attribute must have at least :min items.', + 'file' => 'The :attribute must be at least :min kilobytes.', + 'string' => 'The :attribute must be at least :min characters.', + 'array' => 'The :attribute must have at least :min items.', ], - 'not_in' => 'The selected :attribute is invalid.', - 'not_regex' => 'The :attribute format is invalid.', - 'numeric' => 'The :attribute must be a number.', - 'password' => 'The password is incorrect.', - 'present' => 'The :attribute field must be present.', - 'regex' => 'The :attribute format is invalid.', - 'required' => 'The :attribute field is required.', - 'required_if' => 'The :attribute field is required when :other is :value.', - 'required_unless' => 'The :attribute field is required unless :other is in :values.', - 'required_with' => 'The :attribute field is required when :values is present.', - 'required_with_all' => 'The :attribute field is required when :values are present.', - 'required_without' => 'The :attribute field is required when :values is not present.', + 'multiple_of' => 'The :attribute must be a multiple of :value', + 'not_in' => 'The selected :attribute is invalid.', + 'not_regex' => 'The :attribute format is invalid.', + 'numeric' => 'The :attribute must be a number.', + 'password' => 'The password is incorrect.', + 'present' => 'The :attribute field must be present.', + 'regex' => 'The :attribute format is invalid.', + 'relatable' => 'This :attribute may not be associated with this resource.', + 'required' => 'The :attribute field is required.', + 'required_if' => 'The :attribute field is required when :other is :value.', + 'required_unless' => 'The :attribute field is required unless :other is in :values.', + 'required_with' => 'The :attribute field is required when :values is present.', + 'required_with_all' => 'The :attribute field is required when :values are present.', + 'required_without' => 'The :attribute field is required when :values is not present.', 'required_without_all' => 'The :attribute field is required when none of :values are present.', - 'same' => 'The :attribute and :other must match.', - 'size' => [ + 'prohibited' => 'The :attribute field is prohibited.', + 'prohibited_if' => 'The :attribute field is prohibited when :other is :value.', + 'prohibited_unless' => 'The :attribute field is prohibited unless :other is in :values.', + 'same' => 'The :attribute and :other must match.', + 'size' => [ 'numeric' => 'The :attribute must be :size.', - 'file' => 'The :attribute must be :size kilobytes.', - 'string' => 'The :attribute must be :size characters.', - 'array' => 'The :attribute must contain :size items.', + 'file' => 'The :attribute must be :size kilobytes.', + 'string' => 'The :attribute must be :size characters.', + 'array' => 'The :attribute must contain :size items.', ], - 'starts_with' => 'The :attribute must start with one of the following: :values.', - 'string' => 'The :attribute must be a string.', - 'timezone' => 'The :attribute must be a valid zone.', - 'unique' => 'The :attribute has already been taken.', - 'uploaded' => 'The :attribute failed to upload.', - 'url' => 'The :attribute format is invalid.', - 'uuid' => 'The :attribute must be a valid UUID.', + 'starts_with' => 'The :attribute must start with one of the following: :values.', + 'string' => 'The :attribute must be a string.', + 'timezone' => 'The :attribute must be a valid zone.', + 'unique' => 'The :attribute has already been taken.', + 'uploaded' => 'The :attribute failed to upload.', + 'url' => 'The :attribute format is invalid.', + 'uuid' => 'The :attribute must be a valid UUID.', /* |-------------------------------------------------------------------------- @@ -147,5 +152,4 @@ */ 'attributes' => [], - ];