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

+5
View File
@@ -3,6 +3,7 @@
namespace Hekmatinasser\Verta\Laravel;
use Hekmatinasser\Verta\Verta;
use Illuminate\Support\Carbon;
use Illuminate\Support\Facades\Validator;
use Illuminate\Support\ServiceProvider;
@@ -87,6 +88,10 @@ class VertaServiceProvider extends ServiceProvider
$this->app->bind('verta', function ($app) {
return new Verta();
});
Carbon::macro('toJalali', function ($timezone = null) {
return new Verta($this, $timezone);
});
}
/**