add syntax sugar for Carbon conversions
This commit is contained in:
1 parent
3e1ef52534
commit
264b4488a6
5 files changed
+39
No files matched your search
@@ -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);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user