├── CHANGELOG.md ├── README.md ├── _config.yml ├── composer.json ├── phpunit.xml ├── pint.json ├── rector.php ├── resources └── lang │ ├── en │ └── messages.php │ └── fa │ └── messages.php └── src ├── Rules ├── Address.php ├── Base64.php ├── CardNumber.php ├── IsNotPersian.php ├── Mobile.php ├── NationalCode.php ├── PersianAlpha.php ├── PersianNumber.php ├── Phone.php ├── PhoneArea.php ├── PostalCode.php ├── Sheba.php └── Username.php └── ValidationRulesServiceProvider.php /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | All notable changes to `iamfarhad/validation` will be documented in this file 4 | 5 | ## v.3.3.0 - 2025-06-07 6 | 7 | **Full Changelog**: https://github.com/iamfarhad/validation/compare/v3.2.0...v.3.3.0 8 | 9 | Added support laravel 12 10 | Added support php 8.4 11 | 12 | ## v3.2.0 - 2024-05-12 13 | 14 | support laravel 11 15 | 16 | ## v3.1.2 - 2023-02-27 17 | 18 | **Full Changelog**: https://github.com/iamfarhad/validation/compare/v3.1.1...v3.1.2 19 | 20 | - Added Base64 validation rule. 21 | 22 | ## v3.1.1 - 2023-02-27 23 | 24 | **Full Changelog**: https://github.com/iamfarhad/validation/compare/v3.0.0...v3.1.1 25 | 26 | - Remove support php 8.0 27 | - Fixed github test workflow 28 | 29 | ## v3.1.0 - 2023-02-27 30 | 31 | **Full Changelog**: https://github.com/iamfarhad/validation/compare/v3.0.0...v3.1.0 32 | 33 | - Added Laravel Pint 34 | - Added PHP Rector 35 | - Added username validation 36 | 37 | ## v3.0.0 - 2023-02-21 38 | 39 | ### What's Changed 40 | 41 | - support-laravel-10 by @farshidrezaei in https://github.com/iamfarhad/validation/pull/104 42 | - remove support laravel 6 and 8 43 | - remove support php 7.* 44 | 45 | ### New Contributors 46 | 47 | - @farshidrezaei made their first contribution in https://github.com/iamfarhad/validation/pull/104 48 | 49 | **Full Changelog**: https://github.com/iamfarhad/validation/compare/v2.3.2...v3.0.0 50 | 51 | ## v2.3.2 - 2022-02-01 52 | 53 | ## What's Changed 54 | 55 | - Publish language files into the defined lang path by @WiGeeky in https://github.com/iamfarhad/validation/pull/102 56 | 57 | ## New Contributors 58 | 59 | - @WiGeeky made their first contribution in https://github.com/iamfarhad/validation/pull/102 60 | 61 | **Full Changelog**: https://github.com/iamfarhad/validation/compare/v2.3.1...v2.3.2 62 | 63 | ## v2.3.1 - 2022-01-12 64 | 65 | ## What's Changed 66 | 67 | - added testbench 7.0 68 | 69 | **Full Changelog**: https://github.com/iamfarhad/validation/compare/v2.3.0...v2.3.1 70 | 71 | ## v2.3.0 - 2022-01-12 72 | 73 | ## What's Changed 74 | 75 | - Allow Laravel 9 76 | 77 | **Full Changelog**: https://github.com/iamfarhad/validation/compare/v2.2.2...v2.3.0 78 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Latest Stable Version](https://poser.pugx.org/iamfarhad/validation/v/stable)](https://packagist.org/packages/iamfarhad/validation) 2 | [![License](https://poser.pugx.org/iamfarhad/validation/license)](https://packagist.org/packages/iamfarhad/validation) 3 | [![Total Downloads](https://poser.pugx.org/iamfarhad/validation/downloads)](https://packagist.org/packages/iamfarhad/validation) 4 | 5 | # Laravel Persian Validation 6 | 7 | The Laravel Persian Validation package offers comprehensive validation for the Persian language, including validation for Persian alphabets, numbers, and other Persian-specific elements. This package allows developers to ensure that their Persian language input data meets the necessary validation criteria, enhancing the reliability and accuracy of their applications. With Laravel Persian Validation, developers can easily incorporate Persian language validation into their Laravel projects, providing a more inclusive and user-friendly experience for Persian-speaking users. 8 | 9 | 10 | 11 | 12 | ## Requirement 13 | 14 | * Laravel 10.x | 11.x | 12.x 15 | * PHP 8.1 | 8.2 | 8.3 | 8.4 16 | 17 | ## Install 18 | 19 | Via Composer 20 | 21 | ``` bash 22 | $ composer require iamfarhad/validation 23 | ``` 24 | 25 | This package is designed to automatically register itself without requiring any additional configuration. 26 | 27 | 28 | ### Translations 29 | 30 | If you would like to customize the translations for the Laravel Persian Validation package, you can use the following command to publish them into your project's resources/lang directory: 31 | 32 | ```bash 33 | php artisan vendor:publish --provider="Iamfarhad\Validation\ValidationRulesServiceProvider" --tag="translations" 34 | 35 | ``` 36 | If you are using Laravel 9.x or later, the translations will be published to the /lang directory instead. Once the translations are published, you can modify them as needed to suit your project's requirements. 37 | 38 | 39 | ```bash 40 | php artisan vendor:publish --provider="Iamfarhad\Validation\ValidationRulesServiceProvider" 41 | ``` 42 | 43 | ## Testing 44 | You can run the tests with: 45 | 46 | ```bash 47 | composer test 48 | ``` 49 | 50 | ## Usage 51 | 52 | You can access to validation rules by passing the rules key according blew following table: 53 | 54 | | Rules | Descriptions | 55 | |---------------------|---------------------------------------------------------------------------------------------------| 56 | | new PersianAlpha() | Persian alphabet | 57 | | new PersianNumber() | Persian numbers | 58 | | new Mobile() | Iran mobile numbers | 59 | | new Sheba() | Iran Sheba numbers | 60 | | new NationalCode() | Iran melli code | 61 | | new IsNotPersian() | Doesn't accept Persian alphabet and numbers | 62 | | new Mobile() | Iran mobile numbers | 63 | | new Phone() | Iran phone numbers | 64 | | new PhoneArea() | Iran phone numbers with area code | 65 | | new CardNumber() | Payment card numbers | 66 | | new Address() | Accept Persian, English and ... alphabet, Persian and English numbers and some special characters | 67 | | new PostalCode() | Iran postal code | 68 | | new Username() | Username format | 69 | | new Base64() | Base64 format | 70 | 71 | ### Persian Alphabet 72 | Accept Persian language alphabet according to standard Persian, this is the way you can use this validation rule: 73 | 74 | ``` php 75 | Validator::make( 76 | ['name' => 'فارسی'], 77 | ['name' => [new PersianAlpha()] 78 | ); 79 | ``` 80 | 81 | ### Persian numbers 82 | Validate Persian standard numbers (۰۱۲۳۴۵۶۷۸۹): 83 | 84 | ``` php 85 | Validator::make( 86 | ['num' => '۰۱۲۳۴۵۶۷۸۹'], 87 | ['num' => [new PersianNumber()] 88 | ); 89 | ``` 90 | 91 | ### Iran mobile phone 92 | Validate Iran mobile phones (irancel, rightel, hamrah-e-aval, ...): 93 | 94 | ``` php 95 | Validator::make( 96 | ['mob' => '09127777777'], 97 | ['mob' => [new Mobile()] 98 | ); 99 | ``` 100 | 101 | ### Sheba number 102 | Validate Iran bank sheba numbers: 103 | 104 | ``` php 105 | Validator::make( 106 | ['sheba_number' => 'IR062960000000100324200001'], 107 | ['sheba_number' => [new Sheba()] 108 | ); 109 | ``` 110 | 111 | ### Iran national code 112 | Validate Iran national code (melli-code): 113 | 114 | ``` php 115 | Validator::make( 116 | ['codeMelli' => '3240175800'], 117 | ['codeMelli' => [new NationalCode()] 118 | ); 119 | ``` 120 | 121 | ### Payment card number 122 | Validate Iran payment card numbers: 123 | 124 | ``` php 125 | Validator::make( 126 | ['card' => '6274129005473742'], 127 | ['card' => [new CardNumber()] 128 | ); 129 | ``` 130 | 131 | ### Iran postal code 132 | Validate Iran postal code: 133 | 134 | ``` php 135 | Validator::make( 136 | ['postal' => '16719735744'], 137 | ['postal' => [new PostalCode()] 138 | ); 139 | ``` 140 | 141 | ```php 142 | // in a `FormRequest` 143 | 144 | public function rules() 145 | { 146 | return [ 147 | 'NationalCode' => ['required', new NationalCode()], 148 | ]; 149 | } 150 | ``` 151 | 152 | ## Team 153 | This component is developed by the following person(s) 154 | 155 | | [![Farhad Zand](https://avatars3.githubusercontent.com/u/1936147?v=3&s=130)](https://github.com/iamfarhad) | 156 | |------------------------------------------------------------------------------------------------------------| 157 | | [Farhad Zand](https://github.com/iamfarhad) | 158 | 159 | ## Support This Project 160 | 161 | Great! It's always helpful to have more contributors to a package. Here are a few ways you can contribute to the package completion: 162 | 163 | * Report Issues: If you find any bugs or issues with the package, you can report them on the package's GitHub repository. Be sure to provide detailed steps to reproduce the issue and any relevant code snippets. 164 | * Submit Pull Requests: If you have a fix for a bug or an improvement to the package, you can submit a pull request on the package's GitHub repository. Be sure to follow the guidelines for contributing and to test your changes thoroughly. 165 | * Improve Documentation: If you find any gaps in the package's documentation, you can contribute by improving the existing documentation or adding new documentation. You can do this by submitting a pull request on the package's GitHub repository. 166 | * Spread the Word: You can help the package by spreading the word about it on social media, developer forums, and other channels. This can help attract more contributors and users to the package. 167 | 168 | Remember that contributing to open-source projects like this package is a collaborative effort, and every little bit helps. Thank you for considering contributing! 169 | ## License 170 | 171 | The Laravel persian validation Module is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT) 172 | -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-slate -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "iamfarhad/validation", 3 | "description": "laravel persian validation package", 4 | "license": "MIT", 5 | "keywords": [ 6 | "laravel", 7 | "validation", 8 | "validator", 9 | "persian", 10 | "farsi", 11 | "iran", 12 | "lumen", 13 | "custom", 14 | "rule", 15 | "lumen" 16 | ], 17 | "authors": [ 18 | { 19 | "name": "Farhad Zand", 20 | "email": "farhad.pd@gmail.com" 21 | } 22 | ], 23 | "require": { 24 | "php": "^8.1", 25 | "illuminate/support": "^10.0|^11.0|^12.0" 26 | }, 27 | "autoload": { 28 | "psr-4": { 29 | "Iamfarhad\\Validation\\": "src/" 30 | } 31 | }, 32 | "autoload-dev": { 33 | "psr-4": { 34 | "Iamfarhad\\Validation\\Tests\\": "tests/" 35 | } 36 | }, 37 | "require-dev": { 38 | "laravel/pint": "^1.6", 39 | "rector/rector": "^0.19.2", 40 | "orchestra/testbench": "^6.23|^7.0|^8.0|^9.0", 41 | "phpunit/phpunit": "^9.4|^10.1|^11.0" 42 | }, 43 | "extra": { 44 | "laravel": { 45 | "providers": [ 46 | "Iamfarhad\\Validation\\ValidationRulesServiceProvider" 47 | ] 48 | } 49 | }, 50 | "scripts": { 51 | "test": "vendor/bin/phpunit", 52 | "test-coverage": "vendor/bin/phpunit --coverage-html coverage" 53 | }, 54 | "config": { 55 | "sort-packages": true 56 | }, 57 | "minimum-stability": "dev", 58 | "prefer-stable": true 59 | } 60 | -------------------------------------------------------------------------------- /phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | src/ 10 | 11 | 12 | 13 | 14 | tests 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /pint.json: -------------------------------------------------------------------------------- 1 | { 2 | "preset": "psr12" 3 | } 4 | -------------------------------------------------------------------------------- /rector.php: -------------------------------------------------------------------------------- 1 | paths([ 12 | __DIR__ . '/resources', 13 | __DIR__ . '/src', 14 | __DIR__ . '/tests', 15 | ]); 16 | 17 | // register a single rule 18 | $rectorConfig->rule(InlineConstructorDefaultToPropertyRector::class); 19 | 20 | // define sets of rules 21 | $rectorConfig->sets([ 22 | LevelSetList::UP_TO_PHP_80, 23 | SetList::CODE_QUALITY, 24 | SetList::DEAD_CODE, 25 | SetList::EARLY_RETURN, 26 | SetList::CODING_STYLE, 27 | SetList::NAMING, 28 | SetList::PRIVATIZATION 29 | ]); 30 | }; 31 | -------------------------------------------------------------------------------- /resources/lang/en/messages.php: -------------------------------------------------------------------------------- 1 | 'must be a persian number.', 5 | 'persianAlpha' => 'must be a persian alphabet.', 6 | 'persian_alphabet_number' => 'must be a persian alphabet or number.', 7 | 'mobile' => 'must be a iran mobile number.', 8 | 'shebaNumber' => 'must be a sheba number.', 9 | 'nationalCode' => 'must be a iran melli code.', 10 | 'isNotPersian' => 'could not be contain persian alpahbet or number.', 11 | 'phone' => 'must be a iran phone number.', 12 | 'phoneArea' => 'must be a iran phone number with area code.', 13 | 'cardNumber' => 'must be a valid payment card number.', 14 | 'address' => 'must be a correct address.', 15 | 'postalCode' => 'must be a iran postal code.', 16 | 'username' => 'invalid format.', 17 | 'base64' => 'invalid base64 format.', 18 | ]; 19 | -------------------------------------------------------------------------------- /resources/lang/fa/messages.php: -------------------------------------------------------------------------------- 1 | 'عدد وارد شده باید فارسی باشد.', 5 | 'persianAlpha' => 'حروف وارد شده باید فارسی باشد.', 6 | 'persian_alphabet_number' => 'حروف و عدد وارد شده باید فارسی باشد.', 7 | 'mobile' => 'شماره همراه قابل قبول نیست.', 8 | 'shebaNumber' => 'شماره شبا قابل قبول نیست.', 9 | 'nationalCode' => 'کد ملی قابل قبول نیست.', 10 | 'isNotPersian' => 'حروف غیر لاتین قابل قبول نیست.', 11 | 'phone' => 'شماره تلفن قابل قبول نیست.', 12 | 'phoneArea' => 'شماره تلفن قابل قبول نیست.', 13 | 'cardNumber' => 'شماره کارت قابل قبول نیست.', 14 | 'address' => 'آدرس وارد شده قابل قبول نیست.', 15 | 'postalCode' => 'کدپستی وارد شده قابل قبول نیست.', 16 | 'username' => 'نام کاربری وارد شده قابل قبول نیست.', 17 | 'base64' => 'مقدار وارد شده قابل قبول نیست.', 18 | ]; 19 | -------------------------------------------------------------------------------- /src/Rules/Address.php: -------------------------------------------------------------------------------- 1 | attribute = $attribute; 14 | 15 | return preg_match( 16 | "#^[\pL\s\d\-\/\,\،\.\\\x{200c}\x{064b}\x{064d}\x{064c}\x{064e}\x{064f}\x{0650}\x{0651}\x{6F0}-\x{6F9}]+$#u", 17 | $value 18 | ); 19 | } 20 | 21 | public function message(): string 22 | { 23 | return __('validationRules::messages.address', [ 24 | 'attribute' => $this->attribute, 25 | ]); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/Rules/Base64.php: -------------------------------------------------------------------------------- 1 | attribute = $attribute; 14 | 15 | return base64_encode(base64_decode($value, true)) === $value; 16 | } 17 | 18 | public function message(): string 19 | { 20 | return __('validationRules::messages.base64', [ 21 | 'attribute' => $this->attribute, 22 | ]); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/Rules/CardNumber.php: -------------------------------------------------------------------------------- 1 | attribute = $attribute; 14 | 15 | if (! preg_match('#^\d{16}$#', $value)) { 16 | return false; 17 | } 18 | 19 | $sum = 0; 20 | for ($position = 1; $position <= 16; ++$position) { 21 | $temp = $value[$position - 1]; 22 | $temp = $position % 2 === 0 ? $temp : $temp * 2; 23 | $temp = $temp > 9 ? $temp - 9 : $temp; 24 | $sum += $temp; 25 | } 26 | 27 | return $sum % 10 === 0; 28 | } 29 | 30 | public function message(): string 31 | { 32 | return __('validationRules::messages.cardNumber', [ 33 | 'attribute' => $this->attribute, 34 | ]); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/Rules/IsNotPersian.php: -------------------------------------------------------------------------------- 1 | attribute = $attribute; 14 | 15 | if (is_string($value)) { 16 | return ! preg_match("#[\x{600}-\x{6FF}]#u", $value); 17 | } 18 | 19 | return false; 20 | } 21 | 22 | public function message(): string 23 | { 24 | return __('validationRules::messages.isNotPersian', [ 25 | 'attribute' => $this->attribute, 26 | ]); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/Rules/Mobile.php: -------------------------------------------------------------------------------- 1 | attribute = $attribute; 14 | 15 | return preg_match('#^((0)(9){1}\d{9})+$#', $value); 16 | } 17 | 18 | public function message(): string 19 | { 20 | return __('validationRules::messages.mobile', [ 21 | 'attribute' => $this->attribute, 22 | ]); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/Rules/NationalCode.php: -------------------------------------------------------------------------------- 1 | attribute = $attribute; 14 | if (! preg_match('#^\d{8,10}$#', $value)) { 15 | return false; 16 | } 17 | 18 | if (preg_match('#^[0]{10}|[1]{10}|[2]{10}|[3]{10}|[4]{10}|[5]{10}|[6]{10}|[7]{10}|[8]{10}|[9]{10}$#', $value)) { 19 | return false; 20 | } 21 | 22 | $sub = 0; 23 | if (strlen($value) == 8) { 24 | $value = '00'.$value; 25 | } elseif (strlen($value) == 9) { 26 | $value = '0'.$value; 27 | } 28 | 29 | for ($i = 0; $i <= 8; ++$i) { 30 | $sub += $value[$i] * (10 - $i); 31 | } 32 | 33 | $control = ($sub % 11) < 2 ? $sub % 11 : 11 - ($sub % 11); 34 | 35 | return $value[9] == $control; 36 | } 37 | 38 | public function message(): string 39 | { 40 | return __('validationRules::messages.nationalCode', [ 41 | 'attribute' => $this->attribute, 42 | ]); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/Rules/PersianAlpha.php: -------------------------------------------------------------------------------- 1 | attribute = $attribute; 14 | 15 | return preg_match("#^[\x{600}-\x{6FF}\x{200c}\x{064b}\x{064d}\x{064c}\x{064e}\x{064f}\x{0650}\x{0651}\s]+$#u", $value); 16 | } 17 | 18 | public function message(): string 19 | { 20 | return __('validationRules::messages.persianAlpha', [ 21 | 'attribute' => $this->attribute, 22 | ]); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/Rules/PersianNumber.php: -------------------------------------------------------------------------------- 1 | attribute = $attribute; 14 | 15 | return preg_match('#^[\x{6F0}-\x{6F9}]+$#u', $value); 16 | } 17 | 18 | public function message(): string 19 | { 20 | return __('validationRules::messages.persianNumber', [ 21 | 'attribute' => $this->attribute, 22 | ]); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/Rules/Phone.php: -------------------------------------------------------------------------------- 1 | attribute = $attribute; 14 | 15 | return preg_match('#^[2-9]\d{7}+$#', $value); 16 | } 17 | 18 | public function message(): string 19 | { 20 | return __('validationRules::messages.phone', [ 21 | 'attribute' => $this->attribute, 22 | ]); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/Rules/PhoneArea.php: -------------------------------------------------------------------------------- 1 | attribute = $attribute; 14 | 15 | return preg_match('#^(0[1-9]{2})[2-9]\d{7}+$#', $value); 16 | } 17 | 18 | public function message(): string 19 | { 20 | return __('validationRules::messages.phoneArea', [ 21 | 'attribute' => $this->attribute, 22 | ]); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/Rules/PostalCode.php: -------------------------------------------------------------------------------- 1 | attribute = $attribute; 14 | 15 | return preg_match("#^(\d{10})$#", $value); 16 | } 17 | 18 | public function message(): string 19 | { 20 | return __('validationRules::messages.postalCode', [ 21 | 'attribute' => $this->attribute, 22 | ]); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/Rules/Sheba.php: -------------------------------------------------------------------------------- 1 | attribute = $attribute; 14 | 15 | $ibanReplaceValues = []; 16 | 17 | if (! empty($value)) { 18 | $value = preg_replace('#[\W_]+#', '', strtoupper($value)); 19 | if (4 > strlen($value)) { 20 | return false; 21 | } 22 | 23 | if (strlen($value) > 34) { 24 | return false; 25 | } 26 | 27 | if (is_numeric($value[0])) { 28 | return false; 29 | } 30 | if (is_numeric($value[1])) { 31 | return false; 32 | } 33 | if (is_numeric($value[0])) { 34 | return false; 35 | } 36 | 37 | if (is_numeric($value[1])) { 38 | return false; 39 | } 40 | 41 | if (! is_numeric($value[2])) { 42 | return false; 43 | } 44 | if (! is_numeric($value[3])) { 45 | return false; 46 | } 47 | if (! is_numeric($value[2])) { 48 | return false; 49 | } 50 | 51 | if (! is_numeric($value[3])) { 52 | return false; 53 | } 54 | 55 | $ibanReplaceChars = range('A', 'Z'); 56 | 57 | foreach (range(10, 35) as $tempvalue) { 58 | $ibanReplaceValues[] = (string) $tempvalue; 59 | } 60 | 61 | $tmpIBAN = substr($value, 4).substr($value, 0, 4); 62 | 63 | $tmpIBAN = str_replace($ibanReplaceChars, $ibanReplaceValues, $tmpIBAN); 64 | 65 | $tmpValue = (int) $tmpIBAN[0]; 66 | 67 | for ($i = 1, $iMax = strlen($tmpIBAN); $i < $iMax; ++$i) { 68 | $tmpValue *= 10; 69 | 70 | $tmpValue += (int) $tmpIBAN[$i]; 71 | 72 | $tmpValue %= 97; 73 | } 74 | 75 | if ($tmpValue != 1) { 76 | return false; 77 | } 78 | 79 | return true; 80 | } 81 | 82 | return false; 83 | } 84 | 85 | public function message(): string 86 | { 87 | return __('validationRules::messages.shebaNumber', [ 88 | 'attribute' => $this->attribute, 89 | ]); 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /src/Rules/Username.php: -------------------------------------------------------------------------------- 1 | attribute = $attribute; 14 | 15 | return preg_match( 16 | "#^[a-z][a-z0-9]*(?:[_\-][a-z0-9]+)*$#i", 17 | $value 18 | ); 19 | } 20 | 21 | public function message(): string 22 | { 23 | return __('validationRules::messages.username', [ 24 | 'attribute' => $this->attribute, 25 | ]); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/ValidationRulesServiceProvider.php: -------------------------------------------------------------------------------- 1 | publishes([ 12 | __DIR__.'/../resources/lang' => app()->langPath() . '/vendor/validationRules', 13 | ]); 14 | 15 | $this->loadTranslationsFrom(__DIR__.'/../resources/lang/', 'validationRules'); 16 | } 17 | } 18 | --------------------------------------------------------------------------------