Quick start
Install RTLY-Kit with Composer. In about five minutes you will convert a Jalali date, check an Iranian national code and catch your first library exception.
enaxon/rtly-kit
The Persian and Arabic RTL toolkit for PHP
Jalali, Hijri and Hebrew calendars, Iranian validators, Persian and Arabic numbers and text, holidays and prayer times in one typed, immutable PHP library. Carbon and Laravel integrations are optional.
Needs only PHP 8.2 or newer. MIT licensed.
Install with Composer and use it right away. There is no config file and no publish step.
composer require enaxon/rtly-kituse function RtlyKit\{jdate, to_persian, is_national_code};
echo jdate('2026-03-21')->format('l j F Y'); // شنبه 1 فروردین 1405
echo to_persian(1405); // ۱۴۰۵
var_dump(is_national_code('0499370899')); // bool(true)Each item links to its guide.
These numbers are counted from the code when the site is built.
The Umm al-Qura table, the official holiday dates and the prayer times were compared with official sources, and the data tables were built from at least two sources each. The accuracy and data page says what was compared and when.
Start from any topic. Each list runs from the simple to the reference.
Install and run your first example.
Install RTLY-Kit with Composer. In about five minutes you will convert a Jalali date, check an Iranian national code and catch your first library exception.
Requirements, installation with Composer or Docker, optional Carbon and Laravel support, supported versions, how to check the install and how to remove the package.
Jalali, Hijri and Hebrew: create, format, compare and convert.
The immutable Jalali (Persian, Solar Hijri) date class. Create and parse dates, format them with PHP date tokens, shift and snap them, compare them and measure the gap, with the exact year range and error behaviour.
The immutable Hijri (Islamic) date class with the Umm al-Qura month table and an arithmetic Tabular variant. Create, parse and format dates in Arabic, Persian or English, shift them, compare them and measure the gap.
The immutable Hebrew (Jewish) date class with ordinal month numbers, Adar I and Adar II in leap years, and month names in English, Hebrew and Persian. Create, parse, format, shift and measure dates.
The shared CalendarDate contract of Jalali, Hijri and Hebrew. How to convert a date between calendars, and how comparing and measuring works across calendars and time zones.
Optional Carbon support. Turn any Carbon instance into a Jalali, Hijri or Hebrew date, and create Carbon dates from calendar parts. The page lists every macro with its return type and errors.
National code, Sheba, bank card, mobile, postal code and plate, with structured results.
How the six Iranian validators work. The shared Validator contract, the Result object, stable error keys, input cleaning and size limits.
Validate Iranian national codes (کد ملی) with the mod-11 check digit, accept Persian and Arabic digits, and read the place-of-issue hint safely.
Validate Sheba (IBAN) numbers with ISO 7064 mod-97-10 and bank card numbers with the Luhn checksum, and look up the issuing bank. The page says where the bank data comes from.
Validate Iranian mobile numbers in every common input form, postal codes and vehicle plates, with operator hints, an allocation flag and parsing.
Digits, thousands separators, number to words, normalization and detection.
Convert between English, Persian and Arabic-Indic digits, format numbers with Persian separators and build Persian ordinals. Every cap and edge case is listed.
Spell integers out in Persian (up to 10^21) and Arabic (up to 10^27), and read Persian number words back into numbers with fromWords().
Spell numbers in Modern Standard Arabic with the right gender, case and vowel marks, up to 10^27, and write the ordinals from 1 to 99. Every option is shown with real output.
Normalize Persian and Arabic text, repair half-spaces, detect language and direction, and build URL-safe slugs. Each tool is described with its exact behavior and edge cases.
Iranian public holidays and prayer time calculation.
Look up official Iranian public holidays for any Jalali date, list a whole year, and find business days. Official dates are used for 1394 to 1405, and other years are estimated.
Use official Iranian holiday dates, see where each date comes from, and fix moon-sighting differences with your own offsets, month starts and extra or removed days.
Compute Fajr, sunrise, Dhuhr, Asr, Maghrib and Isha for any place with six calculation methods, high-latitude rules and manual tuning. The page lists what each method was checked against.
Service provider, validation rules, facade and Eloquent cast.
How RTLY-Kit plugs into Laravel. Package auto-discovery, what the service provider registers, the Jalali facade, the optional config file and the fa, en and ar validation messages.
Use the Iranian validation rules in Laravel forms, store Jalali dates in Eloquent models with JalaliCast, and show them in Blade.
Helpers, errors, API stability, data accuracy, limits and upgrading.
The 27 namespaced helper functions, how to import them, and the opt-in Globals::register() that adds short global names without ever replacing yours.
Which calls throw and which never do, the exception hierarchy, the stable ErrorCode values, and how to catch and log failures safely.
What you can rely on, what is internal, how versions are numbered before and after 1.0, and which PHP, Laravel and Carbon versions are supported.
Where every embedded data table comes from, what we compared it with and when, and what each result means. Read it before you rely on the results in production.
A small micro-benchmark of RTLY-Kit against morilog/jalali, with the full method, the caveats and a one-line command to reproduce it on your machine.
Every hard limit in one place. Supported year ranges, input size caps, number-word ranges, the Umm al-Qura range, tuning ranges and the other numeric boundaries of the library.
Answers to the questions people ask most. Missing helpers, weekday numbers, string years, time zones, Carbon macros, the Eloquent cast, prayer times and holidays.
Changes that can affect your code before 1.0, with before and after examples and the steps to migrate, plus the highlights of the changelog for the 0.x series.
How to check that a release archive is the file the release workflow built, with a checksum and a build provenance attestation, and how this relates to a Composer install.