Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Ar Php Laravel

Ar Php Laravel Laravel Package

still-code/ar-php-laravel

Laravel wrapper for the Ar-PHP Arabic language library, offering Arabic text shaping, date and number formatting, Hijri dates, transliteration, and other Arabic utilities via a simple service provider and facade. Ideal for Arabic-first Laravel apps needing reliable localization.

View on GitHub
Deep Wiki
Context7

provides a set of tools that enable Arabic website developers to serve professional search, present and process Arabic content in laravel

Frequently asked questions about Ar Php Laravel
How do I install still-code/ar-php-laravel in a Laravel application?
Install it with Composer using composer require still-code/ar-php-laravel. The service provider is auto-discovered, so no manual registration is needed in config/app.php on modern Laravel versions. If you want to customise defaults, publish the package config file with php artisan vendor:publish and then use the provided facade in your controllers, services, or Blade views. There is no database migration or queue setup, so installation is effectively a single Composer command.
Which Laravel and PHP versions does ar-php-laravel support?
Release 3.0.0 adds support for Laravel 13 on PHP ^8.2, which implies the minimum PHP version has moved up from earlier releases. The changelog does not document which Laravel or PHP versions were dropped, so check the composer.json constraints in the tagged release rather than relying on the release notes. If you are pinned to PHP 8.1 or an older Laravel major, stay on the 2.x line or verify compatibility with a test branch first.
How do I convert Gregorian dates to Hijri in Laravel with this package?
The package wraps Ar-PHP's Arabic date utilities, so you can convert between Gregorian and Hijri calendars and format the output in Arabic through the facade. This is useful for invoices, contracts, and receipts that need dual dating, or for displaying Umm al-Qura style dates alongside standard timestamps. Because conversion errors do not throw exceptions, add unit tests around boundary dates such as month ends and leap years in your own application.
Can ar-php-laravel spell out amounts in Arabic words for invoices?
Yes, Ar-PHP includes number-to-Arabic-words conversion, which this wrapper exposes through the Laravel facade. That makes it practical to print a spelled-out total next to the numeric amount on Arabic invoices and receipts, which is often a legal or accounting requirement in the region. Always test the generated text with a native Arabic reviewer, since the failure mode here is incorrect wording rather than an error you would catch in logs.
Does this package handle Arabic text shaping for PDF generation?
The underlying Ar-PHP library provides Arabic glyph shaping and letter joining, which is exactly what you need when a PDF engine lacks native Arabic support and renders disconnected letters. The wrapper gives you access to that shaping from Laravel, so you can prepare strings before passing them to a PDF renderer. Note that shaping is only part of the problem: you still need a font with Arabic glyphs and correct right-to-left layout in your PDF toolchain.
Can I use ar-php-laravel for Arabic search, sorting, and text normalisation?
Ar-PHP includes Arabic-aware text normalisation and sorting helpers, which the package exposes to Laravel applications. These are useful for cleaning user input before search queries, stripping diacritics and normalising alef variants, or sorting Arabic names in a linguistically sensible order. For large datasets, prefer database-level collation and full-text indexing, and use this package for the preprocessing and display layers.
Is ar-php-laravel a replacement for PHP intl or Laravel's built-in localisation?
Not entirely, and the overlap matters. PHP's intl extension already provides NumberFormatter and IntlDateFormatter with Arabic locales, and ICU covers Islamic calendars, while Laravel's translation layer handles locale strings and pluralisation. The genuine differentiators here are Arabic glyph shaping, number-to-Arabic-words spelling, and Arabic-specific normalisation. If your only requirement is Arabic pluralisation or formatted currency, intl with fewer moving parts is usually the better choice.
What PHP extensions does ar-php-laravel require?
Ar-PHP historically relies on mbstring and iconv for character encoding and conversion work, so confirm both are enabled in every runtime image you deploy to. Verify the exact requirements against the composer.json of the version you install and against your production, CI, and local Docker images. Missing extensions can surface as garbled Arabic output rather than a clear failure, so test rendering in a container that mirrors production.
What license does ar-php-laravel and its Ar-PHP dependency use?
The upstream Ar-PHP library has historically shipped under LGPL-3.0, and this Laravel wrapper is a small community package on top of it. For most commercially distributed Laravel applications, using it as a Composer dependency is acceptable, but the license should be confirmed by your legal team rather than assumed. It becomes a genuine gating item if you redistribute the code, ship an on-premise appliance, or bundle the source in a way that triggers LGPL obligations.
Is it safe to upgrade from 2.0.4 to 3.0.0 of ar-php-laravel, and how should I verify Arabic output?
Version 3.0.0 is a major bump whose documented change is Laravel 13 support on PHP ^8.2, with the remaining release entries being CI dependency updates, and the changelog does not include a breaking-changes section. Treat it as potentially breaking until you diff the composer.json constraints and run your test suite. Before and after upgrading, assert on actual Arabic strings: shaped glyph output, Hijri conversion around month boundaries, and spelled-out numbers, because this library fails by producing wrong text rather than throwing exceptions. Also ask the maintainer how long the 2.x line will keep receiving fixes if you need to defer the upgrade.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core