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

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

Quick view

Installation

composer require hekmatinasser/verta

Usage

echo verta(); //1401-05-24 00:00:00

Gregorian to Jalali

echo verta('2022-08-15'); //1401-05-24 00:00:00

jalali to Gregorian

echo Verta::parse('1401-05-24 14:12:32')->datetime(); //2022-08-15 00:00:00

Carbon to Jalali

echo now()->toJalali(); //1401-05-24 00:00:00

Jalali to Carbon

echo verta()->toCarbon(); //2022-08-15 00:00:00

view more function

Getters

$v = verta(); // 1396-03-14 14:18:23
echo $v->year; // 1396

view more getter

Setters

$v = verta(); // 1396-03-14 14:18:23
echo $v->year = 1395;

view more setter

Fluent Setters

$v = verta(); // 1396-03-14 14:18:23
echo $v->setTimeString('12:25:45');

view more fluent setter

Formatting

echo verta()->format('Y.m.d'); // 1401.05.24
echo verta()->formatWord('l dS F'); // دوشنبه بیست و چهارم مرداد

view more format

Common Formats

echo verta()->formatJalaliDatetime(); // output 1395/10/07 14:12:25

view more common format

Difference for Humans

echo verta('-13 month')->formatDifference(); // 1 سال قبل

view more format difference

Modification

echo verta()->addWeeks(3); 
...

view more modifications

Boundaries

echo verta()->startWeek(3); 

view more boundaries

Compression

echo verta('+2 day')->gte('2022-08-15');

view more compression

Difference

echo verta('+13 day')->diffMonths('2022-08-15'); 

view more differences

Validation

echo Verta::isLeapYear(1394); // false

view more validations

Localization

Verta::setLocale('ar');

view more localizations

Validation Request

'birthday' => ['required', 'jdate_before_equal']

view more localizations

Licence

This package has been created by Nasser Hekmati under the license of MIT.

Contributors

Thanks to people who contributed for grow verta.

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.
adachsoft/changelog-linter
adachsoft/collection
payerurl/telegrambot-crypto-payment-instant-payout
dskripchenko/laravel-hybrid-search
riorizkyrainey/lara-ced
mehedimi/static-vel
zharp/zharp
nonsapiens/bigquery-model-sync
lgu-bayambang-ict-office/lgu-laravel-development-standards
andydefer/laravel-support
se7enxweb/flysystem
lampwick/laravel
jeslage/statamic-emojis
micahdshackelford/rmap-laravel
draftsmaninc/draftsman
square-bit/laravel-volition
himito/laravel-mailman
htinlynn/genius-helper
maco-studios/hephaestus
adachsoft/php-code-style