add syntax sugar for Carbon conversions

This commit is contained in:
Mahdi Ziraki committed 2022-02-21 00:15:17 +03:30
1 parent 3e1ef52534
commit 264b4488a6
5 files changed
+39

No files matched your search

+8
View File
@@ -118,6 +118,12 @@ return new Verta($dt); // 1395-12-09 15:05:56
<pre>
$c = \Carbon::now();
return verta($c); // 1395-12-09 15:05:56
// or
\Illuminate\Support\Carbon::now()->toJalali(); // 1395-12-09 15:05:56
// or with laravel helper
now()->toJalali(); // 1395-12-09 15:05:56
// or in models
return $model->created_at->toJalali();
</pre>
<p>To use the jalali datetime as a string, use the following command</p>
<pre>
@@ -165,6 +171,8 @@ $dt = verta()->datetime();
<p>Verta to Carbon, use the following command</p>
<pre>
$c = Carbon::instance($v->datetime());
// or
$c = $v->toCarbon();
</pre>
<h3 id="property">Property</h3>
<p>To get property, use the following command</p>