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
Laravel Toman

Laravel Toman Laravel Package

evryn/laravel-toman

Laravel Toman makes it easy to work with Iranian currency: convert Rial to Toman, format and localize prices, validate amounts, and handle Persian numerals. A lightweight helper package for clean, consistent money handling in Laravel apps.

View on GitHub
Deep Wiki
Context7

💰 Elegant IDPay and Zarinpal gateway for Laravel

Frequently asked questions about Laravel Toman
How do I install evryn/laravel-toman in a Laravel application?
Install it with Composer using composer require evryn/laravel-toman. The package supports Laravel auto-discovery, so the service provider and facade are registered without editing config/app.php. There are no schema changes, queue workers, or cache dependencies to configure, so setup is essentially the Composer install plus publishing any config file the package offers.
Is laravel-toman an IDPay and Zarinpal payment gateway package?
The Composer description mentions IDPay and Zarinpal gateways, but the documented feature set and the technical evaluation describe a currency helper: Toman/Rial conversion, formatting, localization, amount validation, and Persian numerals. Confirm the actual public API in the repository README before assuming any gateway integration exists. If your requirement is payment processing rather than price formatting, verify the package scope against your gateway needs first.
Does evryn/laravel-toman support Laravel 12?
Yes, v4.1.0 added Laravel 12 support through an external contribution, alongside existing Laravel 10 and 11 support. Laravel 12 requires PHP 8.2 or newer, so check the tagged composer.json for the PHP floor and framework constraints rather than relying on the changelog alone. If that release dropped Laravel 10 constraints, teams still on Laravel 10 should pin to v4.0.x.
How do I convert Rial to Toman with laravel-toman?
The package wraps Toman-denominated conversion helpers into Laravel's service container and facade, so you can convert Rial amounts and format them consistently in one place. The Rial-to-Toman boundary is a factor of ten and is the most likely source of silent pricing errors, so assert it explicitly in tests. Before adopting it, also check whether the documented examples and config defaults assume Toman or Rial.
Can I format prices in Blade templates with Persian numerals?
Yes, the package integrates with Blade and handles localization and Persian digits, which lets it replace scattered number_format() calls in your views. The recommended pattern is to standardize on the helper inside a single Blade component or a Price value object rather than calling it ad hoc throughout templates. That keeps display logic consistent and makes any future swap cheap.
Does laravel-toman provide validation rules for amounts?
It registers a handful of amount validation rules with Laravel's validator layer, alongside its conversion and formatting helpers. Treat those rules as Toman-aware and confirm whether they expect Toman or Rial input before applying them to existing request classes. Pairing them with the same conversion helper used for display keeps validation and rendering in the same unit.
How does laravel-toman handle rounding and negative amounts?
The available material does not clearly state whether rounding mode and negative-value handling are exposed explicitly or inherited from PHP's defaults. Test zero, negative, and large boundary amounts such as just over one million, and assert the exact formatted output. If rounding matters to your business rules, wrap the helper so the policy is defined in one place.
How do I upgrade laravel-toman from v3 to v4?
Treat v3.x to v4 as a major-version upgrade and read the v4 upgrade guide before touching your constraints. Going from v4.0.0 to v4.1.0, by contrast, is a plain Composer update with no code changes implied. Run the update in a feature branch and execute the full test suite before merging.
Is evryn/laravel-toman safe to use in production?
Technically the risk is low: the scope is narrow, the integration surface is a service provider, facade, helpers, and validation rules, and it does not persist data or intercept the request lifecycle. The bigger concern is organisational, since this is a single-maintainer package in a niche ecosystem that sits directly in the money path of your UI. Add golden-file tests covering zero, negatives, and representative large amounts so a silent formatting regression fails CI.
What are the alternatives to laravel-toman for Iranian currency formatting?
The usual alternative is hand-rolled number_format() and Rial-to-Toman conversion logic scattered across views and controllers, which is exactly what this package replaces by centralising a formatting convention. Other money or Iranian-currency packages exist, but the architectural value here is the single tested policy rather than unique features. Hiding the helper behind a Blade component or Price value object keeps any future swap inexpensive.
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.
3mdikram/worldmoneywords
snowsoft/config
itmosoft/laravel-subscriptions
larva/laravel-ai-qwen
diephp/sequences
users-au/socialite-provider
twidpay/twid-logger
mrnewport/laravel-plaid
mrnewport/laravel-repo
mrnewport/laravel-docsign
mrnewport/laravel-stow
mrnewport/laravel-flow
mrnewport/laravel-priceable
mrnewport/laravel-nestedterms
fredmeng/laravel-apidoc-generator
itstructure/laravel-multilingual-tools
pdustdar/elasticsearch
markupai/php-sdk
rlacerda83/lumem-microservice-shipment
uni-method/symfony-lib