2018-01-13 16:06:19 -06:00
|
|
|
<?php
|
|
|
|
|
|
2026-10-05 18:10:18 -04:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
2018-01-13 16:06:19 -06:00
|
|
|
namespace Pterodactyl\Providers;
|
|
|
|
|
|
|
|
|
|
use Illuminate\Support\ServiceProvider;
|
2026-10-05 18:10:18 -04:00
|
|
|
use Illuminate\View\Compilers\BladeCompiler;
|
2018-01-13 16:06:19 -06:00
|
|
|
|
|
|
|
|
class BladeServiceProvider extends ServiceProvider
|
|
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* Perform post-registration booting of services.
|
|
|
|
|
*/
|
2023-02-23 12:30:16 -07:00
|
|
|
public function boot(): void
|
2018-01-13 16:06:19 -06:00
|
|
|
{
|
2026-10-05 18:10:18 -04:00
|
|
|
$this->app->make(BladeCompiler::class)
|
|
|
|
|
->directive('datetimeHuman', fn (string $expression): string => "<?php echo \Carbon\CarbonImmutable::createFromFormat(\Carbon\CarbonImmutable::DEFAULT_TO_STRING_FORMAT, $expression)->setTimezone(config('app.timezone'))->toDateTimeString(); ?>");
|
2018-01-13 16:06:19 -06:00
|
|
|
}
|
|
|
|
|
}
|