PHPackages                             va/cutlet-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. [Validation &amp; Sanitization](/categories/validation)
4. /
5. va/cutlet-helper

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

va/cutlet-helper
================

A package to use helper functions and Iranian Validator in laravel apps.

v1.5.5(3y ago)2848121MITPHPPHP ^7.1.3|8.\*

Since Jun 3Pushed 3y ago1 watchersCompare

[ Source](https://github.com/imvahid/cutlet-helper)[ Packagist](https://packagist.org/packages/va/cutlet-helper)[ Docs](https://github.com/va1hi9da9sh2ou0rz2ad1eh7/cutlet-helper)[ RSS](/packages/va-cutlet-helper/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (1)Versions (48)Used By (1)

Laravel Cutlet Helper
=====================

[](#laravel-cutlet-helper)

[![Latest Version on Packagist](https://camo.githubusercontent.com/80fe7d4af3882d0667e0ac0aa58882915ff885e35a3f6a340c81b4ecd6ba601d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f76612f6375746c65742d68656c7065722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/va/cutlet-helper)[![GitHub issues](https://camo.githubusercontent.com/e9c66a0e9b04a2597aa069c7cb11a936399d4aa905a07861099bc0ff7c97c0c5/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f696d76616869642f6375746c65742d68656c7065723f7374796c653d666c61742d737175617265)](https://github.com/imvahid/cutlet-helper/issues)[![GitHub stars](https://camo.githubusercontent.com/e755cc7ae49deee08ce463834538699fc2a92bc1d58792b72fc28841d100c0c0/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f696d76616869642f6375746c65742d68656c7065723f7374796c653d666c61742d737175617265)](https://github.com/imvahid/cutlet-helper/stargazers)[![GitHub forks](https://camo.githubusercontent.com/af63749ac15078dee3eb4ebd885fbb3aab61dd9826782cb381c50be344573834/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f726b732f696d76616869642f6375746c65742d68656c7065723f7374796c653d666c61742d737175617265)](https://github.com/imvahid/cutlet-helper/network)[![Total Downloads](https://camo.githubusercontent.com/73cba0913212aff5f56c4402ea04250bb322258de34a48a6ab6bc33dadef2e98/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f76612f6375746c65742d68656c7065722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/va/cutlet-helper)[![GitHub license](https://camo.githubusercontent.com/64c8750984c3fc4497554a4c2c7b9061545c1c261a3b7bd9062d4eef6fd187c7/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f696d76616869642f6375746c65742d68656c7065723f7374796c653d666c61742d737175617265)](https://github.com/imvahid/cutlet-helper/blob/master/LICENSE)

### Quick links

[](#quick-links)

- [Installation](#installation)
- [Publish Config file](#publish-config-file)
- [Helper functions and facades that exists in package](#helper-functions-and-facades-that-exists-in-package)
- [Helper Functions Usage](#helper-functions-usage)
- [Validators that exists in package](#validators-that-exists-in-package)
- [Validators Usage](#validators-usage)
- [Categories Usage](#categories-usage)
- [Requirements](#requirements)

### Installation

[](#installation)

```
composer require va/cutlet-helper

```

#### Publish Config file

[](#publish-config-file)

```
php artisan vendor:publish --tag=cutlet-helper

```

#### Helper functions and facades that exists in package

[](#helper-functions-and-facades-that-exists-in-package)

```
integerToken($length = 5) // Generate integer token or code

stringToken($length = 16, $characters = '2345679acdefghjkmnpqrstuvwxyz') // Generate string token or code

digitsToEastern($number) // Covert a Weatern number(English) or digits to Eastern number(Persian or Arabic)

easternToDigits($number) // Covert a Eastern number(Persion, Arabic) to Eastern number(English)

isActive($key, $activeClassName = 'active') // Check the route name(string) or route names(array) is avtive or no for css classes

prepareInteger(input: string or integer) // removes `,` from integer (can be used in request for prices)

prepareSlug(slug, title, model) // generate clean slug from title and checks slug unique in specific model
```

#### Helper Functions Usage

[](#helper-functions-usage)

```
// With Facade format:

CutletHelper::integerToken(length: 10);
CutletHelper::stringToken(length: 32, characters: '2345679acdefghjkmnpqrstuvwxyz');
CutletHelper::digitsToEastern(number: 1375);
CutletHelper::easternToDigits(number: ۱۳۷۵);
CutletHelper::isActive(key: ['posts.index', 'posts.create', 'posts.edit'], activeClassName: 'acive');
CutletHelper::prepareInteger(input: string or integer);
CutletHelper::prepareSlug(slug, title, model);

// Call a helper function:

integerToken(length: 10)
stringToken(length: 32, characters: '2345679acdefghjkmnpqrstuvwxyz');
digitsToEastern(number: 1375);
easternToDigits(number: ۱۲۳۴۵);
isActive(key: ['posts.index', 'posts.create', 'posts.edit'], activeClassName: 'acive');
prepareInteger(input: string or integer);
prepareSlug(slug, title, model);
```

#### Validators that exists in package

[](#validators-that-exists-in-package)

- National Code (کد ملی)
- IBAN (شماره شبا)
- Debit Card (شماره کارت بانکی)
- Postal Code (کد پستی)
- Shenase Meli (شناسه ملی)
- Mobile (موبایل)
- Phone (تلفن ثابت)
- Unique Dynamic (تشخیص یکتایی دو ستونه)
- Persian Alphabetic (الفبای فارسی)
- Persian Number (اعداد فارسی)

#### Validators Usage

[](#validators-usage)

> national\_code
>
> A rule for validating Iranian national code [(How calculated)](https://fa.wikipedia.org/wiki/%DA%A9%D8%A7%D8%B1%D8%AA_%D8%B4%D9%86%D8%A7%D8%B3%D8%A7%DB%8C%DB%8C_%D9%85%D9%84%DB%8C#%D8%AD%D8%B3%D8%A7%D8%A8_%DA%A9%D8%B1%D8%AF%D9%86_%DA%A9%D8%AF_%DA%A9%D9%86%D8%AA%D8%B1%D9%84)

```
return [
    'code' => 'required|national_code'
];

// For national_code with exeptions code or valid codes for foreign national codes
// First step for use this parameters is migrate, php artisan migrate, and save your exeptions in this table
// but if you want to use another table you can set your table and column
return [
    'code' => 'required|national_code:national_code_exceptions' // This is default table that contains exeption codes
    // -- OR --
    'code' => 'required|national_code:national_code_exceptions,code' // Second parameter is column of exeption table
];

// -- OR --

return [
    'code' => ['required', 'national_code']
];

// -- OR --

$validatedData = $request->validate([
    'code' => 'national_code',
]);
```

> iban
>
> A rule for validating IBAN (International Bank Account Number) known in Iran as Sheba. [(How calculated)](https://fa.wikipedia.org/wiki/%D8%A7%D9%84%DA%AF%D9%88%D8%B1%DB%8C%D8%AA%D9%85_%DA%A9%D8%AF_%D8%B4%D8%A8%D8%A7#%D8%A7%D9%84%DA%AF%D9%88%D8%B1%DB%8C%D8%AA%D9%85_%DA%A9%D8%AF_%D8%B4%D8%A8%D8%A7)

```
return [
    'account' => 'iban'
];

// -- OR --

// Add `false` optional parameter after `iban`, If IBAN doesn't begin with `IR`, so the validator will add `IR` as default to the account number:
return [
    'account' => 'iban:false'
];

// -- OR --

// If you want to validate non Iranian IBAN, add the 2 letters of country code after `false` optional parameter:
return [
    'account' => 'iban:false,DE'
];
```

> debit\_card
>
> A rule for validating Iranian debit cards. [(How calculated)](http://www.aliarash.com/article/creditcart/credit-debit-cart.htm)

```
return [
    'code' => 'required|debit_card'
];

// -- OR --

return [
    'code' => ['required', 'debit_card']
];

// -- OR --

$validatedData = $request->validate([
    'code' => 'debit_card',
]);

// -- OR --

// You can add an optional parameter if you want to validate a card from a specific bank:
return [
    'code' => 'required|debit_card:bmi'
];

/* List of the bank codes:

 - bmi (بانک ملی)
 - banksepah (بانک سپه)
 - edbi (بانک توصعه صادرات)
 - bim (بانک صنعت و معدن)
 - bki (بانک کشاورزی)
 - bank-maskan (بانک مسکن)
 - postbank (پست بانک ایران)
 - ttbank (بانک توسعه تعاون)
 - enbank (بانک اقتصاد نوین)
 - parsian-bank (بانک پارسیان)
 - bpi (بانک پاسارگاد)
 - karafarinbank (بانک کارآفرین)
 - sb24 (بانک سامان)
 - sinabank (بانک سینا)
 - sbank (بانک سرمایه)
 - shahr-bank (بانک شهر)
 - bank-day (بانک دی)
 - bsi (بانک صادرات)
 - bankmellat (بانک ملت)
 - tejaratbank (بانک تجارت)
 - refah-bank (بانک رفاه)
 - ansarbank (بانک انصار)
 - mebank (بانک مهر اقتصاد)
*/
```

> postal\_code

```
return [
    'code' => 'required|postal_code'
];

// --OR--

return [
    'code' => ['required, 'postal_code']
];

// --OR--

$validatedData = $request->validate([
    'code' => 'postal_code',
]);
```

> shenase\_meli
>
> A rule for validating Iranian shenase meli [(How calculated)](http://www.aliarash.com/article/shenasameli/shenasa_meli.htm)

```
return [
    'code' => 'required|shenase_meli'
];

// --OR--

return [
    'code' => ['required, 'shenase_meli']
];

// --OR--

$validatedData = $request->validate([
    'code' => 'shenase_meli',
]);
```

> mobile

```
return [
    'mobile' => 'required|mobile'
];

// --OR--

return [
    'mobile' => ['required, 'mobile']
];

// --OR--

$validatedData = $request->validate([
    'mobile' => 'mobile',
]);
```

> username (Valid characters: English Alphabetic, Numbers and \_)

```
return [
    'username' => 'required|username'
];

// --OR--

return [
    'username' => ['required, 'username']
];

// --OR--

$validatedData = $request->validate([
    'username' => 'username',
]);
```

> phone

```
return [
    'phone' => 'required|phone'
];

// --OR--

return [
    'phone' => ['required, 'phone']
];

// --OR--

$validatedData = $request->validate([
    'phone' => 'phone',
]);
```

> unique\_dynamic (table\_name, target\_column, extra\_column, extra\_column\_value, ignore\_column, ignore\_column\_value)

```
return [
    // Without ignore for create user, 4 parameters
    // If we want to check a username is unique in users table when type of this useranme equal student
    // If username = 'v.ashourzadeh' and type = 'student' you can't create username = 'v.ashourzadeh' but create username = 'v.ashourzadeh' if type = 'teacher'
    'username' => 'required|unique_dynamic:users,username,type,student'

    // With ignore for edit user, 6 parameters
    // If we want to check a username is unique in users table and ignore this for special id, for example id = 5
    // If username = 'v.ashourzadeh' and type = 'student' you can set username = 'v.ashourzadeh' when id = 5
    'username' => 'required|unique_dynamic:users,username,type,student,id,5'
];

// --OR--

return [
    // Without ignore for create user, 4 parameters
    'username' => ['required, 'unique_dynamic:users,username,type,student']

    // With ignore for edit user, 6 parameter
    'username' => ['required, 'unique_dynamic:users,username,type,student,id,5']
];

// --OR--

$validatedData = $request->validate([
    // Without ignore for create user, 4 parameters
    'username' => 'unique_dynamic:users,username,type,student',
    // With ignore for edit user, 6 parameter
    'username' => 'unique_dynamic:users,username,type,student,id,5',
]);
```

> persian\_alphabetic

```
return [
    'code' => 'required|persian_alphabetic'
];

// --OR--

return [
    'code' => ['required, 'persian_alphabetic']
];

// --OR--

$validatedData = $request->validate([
    'code' => 'persian_alphabetic',
]);
```

> persian\_number

```
return [
    'code' => 'required|persian_number'
];

// --OR--

return [
    'code' => ['required, 'persian_number']
];

// --OR--

$validatedData = $request->validate([
    'code' => 'persian_number',
]);
```

#### Categories Usage

[](#categories-usage)

This package provides category handling for blew table structure with `Category` model:

categories =&gt; `id, slug, title, category_type, description, parent_id, creator_id`

categorizables =&gt; `category_id, categorizable_id, categorizable_type`

> Usage in category create blade :

``

- this tag generates select options , so you can use it in select or select2 tags.
- type: the category type used in the table structure, for example postCategory
- page: the blade page that contains the current tag

> Usage in category edit blade:

``

- parent: that contains current category parent\_id
- category: that contains current category\_id

> Usage in specific create blade that contains category:

``

- this tag generates checkboxes , so you can use it in any div tag.
- type: the category type used in the table structure, for example postCategory
- page: the blade page that contains the current tag

> Usage in specific edit blade that contains category:

``

- checked: an array that contains synced categories with the main object, for example services-&gt;categories

#### Requirements:

[](#requirements)

- PHP v7.0 or above
- Laravel v7.0 or above

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 76.6% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~23 days

Recently: every ~178 days

Total

47

Last Release

1148d ago

PHP version history (6 changes)v1.0.0PHP ^7.1.3|7.2.\*|7.3.\*|7.4.\*

v1.0.8PHP 7.1.\*|7.2.\*|7.3.\*|7.4.\*

v1.1.2PHP &gt;=7.0

v1.1.4PHP &gt;=7.1.3

v1.2.2PHP ^7.1.3

v1.5.2PHP ^7.1.3|8.\*

### Community

Maintainers

![](https://www.gravatar.com/avatar/2fc6e2f33ef978199a48867ee2308f746ba9b630b291ee7c01a07d25d86d0a71?d=identicon)[v.ashourzadeh](/maintainers/v.ashourzadeh)

---

Top Contributors

[![imvahid](https://avatars.githubusercontent.com/u/11843776?v=4)](https://github.com/imvahid "imvahid (49 commits)")[![sinatx](https://avatars.githubusercontent.com/u/76904071?v=4)](https://github.com/sinatx "sinatx (13 commits)")[![foruzanAmiriDavani](https://avatars.githubusercontent.com/u/74909739?v=4)](https://github.com/foruzanAmiriDavani "foruzanAmiriDavani (2 commits)")

---

Tags

phplaravelvalidationhelperscodenationalfunctionscategorycompanyIBANlaravel-helpersdebitlaravel7mellinational idiranianshebalaravel7-packageshenase-melli

### Embed Badge

![Health badge](/badges/va-cutlet-helper/health.svg)

```
[![Health](https://phpackages.com/badges/va-cutlet-helper/health.svg)](https://phpackages.com/packages/va-cutlet-helper)
```

###  Alternatives

[iamfarhad/validation

🇮🇷 Complete Laravel Persian validation package - Iranian national ID, mobile numbers, Shamsi dates, IBAN/Sheba, postal codes &amp; more. Modern Laravel 10-13 support with both ValidationRule objects &amp; string-based rules.

3017.3k](/packages/iamfarhad-validation)[carsdotcom/laravel-json-schema

Json Schema validation for Laravel projects

1043.3k6](/packages/carsdotcom-laravel-json-schema)[yorcreative/laravel-argonaut-dto

Argonaut is a lightweight Data Transfer Object (DTO) package for Laravel that supports nested casting, recursive serialization, and validation out of the box. Ideal for service layers, APIs, and clean architecture workflows.

1063.4k2](/packages/yorcreative-laravel-argonaut-dto)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
