hekmatinasser/verta
Verta provides Jalali (Solar) and Gregorian date conversion plus handy date/time helpers. Extends PHP DateTime, works with Carbon, supports formatting, localization, validation, boundaries, and human-readable diffs—ideal for Laravel and PHP apps needing Persian dates.
now(), Carbon instances).jdate_valid or jdate_before_equal for form handling.formatWord()).isLeapYear(), diffMonths(), and addWeeks() tailored for Jalali calendars.toCarbon()/toJalali()) allows gradual adoption—teams can migrate features incrementally without rewriting date logic.composer require hekmatinasser/verta) with auto-registration via Laravel’s service provider.protected $casts = ['birthday' => 'date:Y-m-d'];).getJalaliBirthdayAttribute()).Carbon’s timezone-aware logic.Carbon for timezone-sensitive operations.^2.65) in composer.json.jalali column type (e.g., via Laravel extensions).verta() (e.g., search/replace, wrapper classes)?spatie/calendar) for broader calendar support if needed?Phase 1: Pilot Feature
composer require hekmatinasser/verta).Carbon with verta() in date-heavy methods (e.g., now()->toJalali()).'date' => 'jdate_valid').Phase 2: Core Integration
Verta::setLocale('fa')).{{ verta()->formatJalaliDatetime() }}).Phase 3: Full Rollout
Carbon::parse() → Verta::parse()).verta() for Jalali, Carbon for Gregorian").Verta instances (e.g., addDays(), diffInMonths()).jdate_valid, jdate_after, and jdate_before_equal.refreshDatabase()).| Step | Task | Dependencies | Risk |
|---|---|---|---|
| 1. Installation | composer require hekmatinasser/verta |
None | Low |
| 2. Pilot Feature | Replace Carbon in a single feature (e.g., blog posts) |
Basic Verta usage | Low |
| 3. Validation Rules | Update form validation to use jdate_* rules |
Pilot feature working | Medium (edge cases) |
| 4. Database Layer | Add Eloquent accessors/mutators for Jalali fields | Pilot feature success | Medium (schema changes) |
| 5. Frontend Sync | Update templates/APIs to use Jalali formats | Database layer working | Low |
| 6. Core Refactor | Replace Carbon in business logic (e.g., services, jobs) |
Frontend sync complete | High (breaking changes) |
| 7. Load Testing | Benchmark performance with production-scale data | Full |
How can I help you explore Laravel packages today?