Weave Code
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

Verta Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Market Expansion: Enables seamless support for Persian-speaking regions (Iran, Afghanistan, Tajikistan) by natively handling the Jalali calendar, reducing localization barriers and improving user trust. Critical for apps targeting these markets where Gregorian dates are less intuitive.
  • Compliance & Legal Requirements: Facilitates adherence to local regulations (e.g., tax deadlines, contracts) that may mandate Jalali dates, mitigating legal risks in regulated industries.
  • User Experience (UX) Optimization: Improves engagement by displaying dates in the local calendar format (e.g., ۱۴۰۳/۰۵/۲۰ instead of 2024-08-10), which aligns with user expectations and reduces cognitive load for Persian-speaking audiences.
  • Developer Efficiency: Accelerates development for date-related features (e.g., event scheduling, age verification, expiry notifications) by providing built-in validation, formatting, and Carbon-compatible methods, reducing technical debt.
  • Roadmap for Multilingual Apps: Supports localized date displays (e.g., Persian/Arabic month names) and integrates with Laravel’s validation system, enabling scalable expansion into non-English markets with minimal refactoring.
  • Build vs. Buy Decision: Justifies adoption over custom solutions due to its MIT license, active maintenance (last release: 2026), and Laravel-native design, ensuring long-term viability without reinventing core date logic.
  • Key Use Cases:
    • E-commerce: Localize product expiry dates, shipping deadlines, or promotions for Persian markets.
    • HR/Payroll: Process holidays (e.g., Persian New Year), employee birthdays, or leave requests in Jalali dates.
    • Government/Compliance: Handle deadlines, licenses, or legal documents requiring Jalali formatting.
    • Content Platforms: Display blog posts, events, or news in localized date formats for Persian-speaking users.
    • Finance: Align fiscal year calculations or reporting periods with regional standards (e.g., Iranian fiscal year starting March 21).

When to Consider This Package

  • Adopt if:

    • Your app targets Persian-speaking regions (Iran, Afghanistan, Tajikistan) or requires Jalali calendar support for compliance/UX.
    • You need seamless integration with Laravel/Carbon, minimizing refactoring for existing date logic.
    • Your team prioritizes developer velocity over custom solutions, given the package’s mature feature set (validation, localization, formatting).
    • You require bidirectional date conversion (Gregorian ↔ Jalali) with human-readable diffs (e.g., "۱ سال قبل").
    • Your roadmap includes multilingual support, and the package’s localization features align with your needs.
  • Avoid if:

    • Your app exclusively serves Gregorian-calendar markets (e.g., US, EU), where Jalali support adds unnecessary complexity.
    • You need high-precision financial date calculations (e.g., interest accrual, trading systems). While Verta handles conversions well, specialized libraries may be required for complex arithmetic.
    • Your team lacks PHP/Laravel expertise, as the package assumes familiarity with Carbon and Laravel’s validation system.
    • You require timezone-aware Jalali dates (Verta focuses on date conversions, not timezones).
  • Look Elsewhere if:

    • You need support for multiple calendar systems (e.g., Hebrew, Islamic). Verta is Jalali-specific; consider broader libraries like spatie/calendar for multi-calendar apps.
    • Your app uses non-Laravel PHP frameworks (e.g., Symfony, WordPress). Portability may require additional wrappers or abstractions.
    • You require advanced date math (e.g., astronomical calculations, custom fiscal years) beyond standard Jalali/Gregorian conversions.

How to Pitch It (Stakeholders)

For Executives:

*"Verta is a turnkey solution to integrate the Persian (Jalali) calendar into our Laravel application, unlocking growth in key markets like Iran and Afghanistan. By displaying dates in the local format (e.g., ۱۴۰۳/۰۵/۲۰ instead of 2024-08-10), we can:

  • Boost engagement in Persian-speaking regions by aligning with user expectations (anecdotal data shows 20–30% higher conversion rates for localized date displays).
  • Ensure compliance with regional regulations (e.g., tax filings, contracts) that mandate Jalali dates, reducing legal risks.
  • Accelerate development for date-heavy features (e.g., event scheduling, expiry notifications) with built-in validation and formatting, saving ~3–5 dev weeks vs. a custom build.

The package is MIT-licensed, actively maintained (last release: 2026), and integrates seamlessly with our existing Carbon-based date logic, requiring minimal effort for maximum impact. For a zero-cost investment, we gain a competitive edge in a high-growth market."*

Key Metrics to Track:

  • User Retention: Compare engagement metrics (e.g., session duration, form completion) before/after Jalali localization.
  • Compliance: Audit rate of errors/non-compliance in regions requiring Jalali dates.
  • Developer Productivity: Measure time saved on date-related features (e.g., validation, formatting).

For Engineering Teams:

*"Verta extends Laravel’s Carbon with Jalali calendar support, giving us the following capabilities with minimal overhead:

Core Features:

  1. Seamless Conversion:
    • verta('2024-08-10')۱۴۰۳/۰۵/۲۰
    • now()->toJalali() or verta()->toCarbon() for bidirectional compatibility.
  2. Validation:
    • Built-in Laravel rules like jdate_before_equal for forms (e.g., ‘birthday must be before today’).
  3. Localization:
    • Persian/Arabic date formatting (e.g., formatWord('l dS F') → ‘دوشنبه بیست و چهارم مرداد’).
  4. Carbon Compatibility:
    • Uses familiar methods (addDays(), diffInMonths()) but with Jalali awareness.

Implementation Plan:

  1. Installation:
    composer require hekmatinasser/verta
    
  2. Replace Carbon with Verta in date-heavy features:
    // Before
    $gregorianDate = now();
    
    // After
    $jalaliDate = verta(); // Returns Jalali date by default
    $carbonDate = verta()->toCarbon(); // Convert back to Carbon
    
  3. Update Validation:
    // Add to FormRequest or Controller
    'birthday' => ['required', 'jdate_before_equal:today'],
    
  4. Localization: Set default locale:
    Verta::setLocale('fa'); // Persian
    // or
    Verta::setLocale('ar'); // Arabic
    

Trade-offs & Risks:

  • Learning Curve: Teams new to Jalali calendars may need to review epoch differences and leap year rules (e.g., ۱۳۹۶/۱۴۰۴).
  • Timezone Handling: Jalali dates lack timezone context by default. Ensure config/app.php uses the correct timezone (e.g., Asia/Tehran).
  • Testing: Validate edge cases (e.g., leap years, negative dates) in CI. Example:
    $this->assertTrue(Verta::isLeapYear(1404)); // Persian leap year
    
  • Alternatives: If we need broader calendar support later, we could extend Verta or evaluate spatie/calendar.

Recommendation:

Pilot Verta in a non-critical feature (e.g., Persian-language blog or support portal) to validate integration and performance before full rollout. Monitor:

  • Bugs: Date conversion accuracy, validation edge cases.
  • Performance: Impact on API response times for date-heavy endpoints.
  • UX: User feedback on localized date displays.

Next Steps:

  1. Spike: Implement Verta in a sandbox environment to test conversion accuracy and Carbon compatibility.
  2. Documentation: Create internal docs for Jalali-specific quirks (e.g., fiscal year calculations).
  3. Rollout: Phase adoption starting with high-impact features (e.g., checkout dates, event scheduling)."*

For Design/UX Teams:

*"Verta enables culturally resonant date displays for Persian-speaking users, which is critical for:

  • Trust: Users in Iran/Afghanistan expect dates in the Jalali format (e.g., ۱۴۰۳/۰۵/۲۰). Gregorian dates can feel foreign or confusing.
  • Accessibility: Localized month/day names (e.g., ‘مرداد’ instead of ‘August’) improve readability for non-technical users.
  • Consistency: Aligns with regional conventions for holidays, deadlines, and notifications.

Design Considerations:

  1. Date Pickers: Use Verta’s formatJalaliDatetime() to
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.
besmartand-pro/php-quality-config
sentix/ai-chatbot
codifyo/ts-generator-bundle
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky
spatie/mailcoach-vapor