toby/app/Providers/AppServiceProvider.php
Adrian Hopek 026bfe485f
#28 - holidays management (#30)
* #28 - holidays management

* #28 - fix

* #28 - fix

* #28 - fix

* #28 - fix

* #28 - fix

* #28 - fix

* #28 - cr fix
2022-01-25 09:02:48 +01:00

25 lines
622 B
PHP

<?php
declare(strict_types=1);
namespace Toby\Providers;
use Illuminate\Support\Carbon;
use Illuminate\Support\ServiceProvider;
use Toby\Models\Holiday;
use Toby\Models\VacationLimit;
use Toby\Scopes\SelectedYearPeriodScope;
class AppServiceProvider extends ServiceProvider
{
public function boot(): void
{
Carbon::macro("toDisplayString", fn() => $this->translatedFormat("j F Y"));
$selectedYearPeriodScope = $this->app->make(SelectedYearPeriodScope::class);
VacationLimit::addGlobalScope($selectedYearPeriodScope);
Holiday::addGlobalScope($selectedYearPeriodScope);
}
}