PHPackages                             dizatech/helper - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. dizatech/helper

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

dizatech/helper
===============

This is a package of simple helper functions which may be useful in any laravel project.

v0.3.1(7mo ago)069MITPHPPHP ^8.0

Since Nov 26Pushed 7mo ago1 watchersCompare

[ Source](https://github.com/dizatech/helper)[ Packagist](https://packagist.org/packages/dizatech/helper)[ RSS](/packages/dizatech-helper/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (2)Versions (12)Used By (0)

Dizatech Helper
===============

[](#dizatech-helper)

Dizatech is a package developed to add validation, banking and view helpers to Laravel projects with Iranian/Persian projects' needs in mind. This package is highly inspired by the works of my dear friend and colleague @imvahid.

Installation
------------

[](#installation)

1. Require the package via composer

```
composer require dizatech/helper
```

2. Run the following command to publish package files

```
php artisan vendor:publish --provider=Dizatech\Helper\DizatechHelperServiceProvider
```

Validation Rules
----------------

[](#validation-rules)

### National Code

[](#national-code)

برای اعتبار سنجی کد ملی شخص حقیقی

Add `new NationalCode()` to validation rules array. String passed for validation must be 10 characters long. National codes with zero(s) in the begining should be passed as string with their leading zeros. It's recommended to zero-pad national codes before using them for any purpose, including validation.

#### Zero-padding example

[](#zero-padding-example)

###### Bare php:

[](#bare-php)

```
$national_code = str_pad($code, 10, '0', STR_PAD_LEFT);
```

###### Inside Laravel reuest file:

[](#inside-laravel-reuest-file)

```
