PHP code example of zarbinco / laravel-persian-core
1. Go to this page and download the library: Download zarbinco/laravel-persian-core library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
zarbinco / laravel-persian-core example snippets
use Zarbinco\PersianCore\Facades\Persian;
Persian::text('علي كاظمي')->normalize();
// علی کاظمی
Persian::number('۱۲۳٤٥۶')->toEnglish();
// 123456
Persian::clean('علي كاظمي شماره ۰۹۱۲۱۲۳۴۵۶۷');
// علی کاظمی شماره 09121234567
Persian::normalize('علي كاظمي شماره 09121234567')->forDisplay();
// علی کاظمی شماره ۰۹۱۲۱۲۳۴۵۶۷
Persian::mobile('۰۹۱۲ ۱۲۳ ۴۵۶۷')->international();
// +989121234567
Persian::money(1250000)->format();
// ۱,۲۵۰,۰۰۰ تومان
Persian::text('علي كاظمي')->normalize();
// علی کاظمی
Persian::text('سلام ، علی ! خوبی ؟')->forDisplay();
// سلام، علی! خوبی؟
Persian::text('میروم')->forSearch();
// می روم
use Zarbinco\PersianCore\Rules\IranianMobile;
use Zarbinco\PersianCore\Rules\IranianNationalCode;
use Zarbinco\PersianCore\Rules\PersianAlpha;
$request->validate([
'name' => ['
use App\Support\CustomTextNormalizer;
use Zarbinco\PersianCore\Contracts\PersianTextNormalizerContract;
$this->app->bind(PersianTextNormalizerContract::class, CustomTextNormalizer::class);
bash
php artisan persian-core:install
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.