Files

21 lines
628 B
PHP
Raw Permalink Normal View History

<?php
2026-10-05 18:10:18 -04:00
declare(strict_types=1);
namespace Pterodactyl\Providers;
use Illuminate\Support\ServiceProvider;
2026-10-05 18:10:18 -04:00
use Illuminate\View\Compilers\BladeCompiler;
class BladeServiceProvider extends ServiceProvider
{
/**
* Perform post-registration booting of services.
*/
2023-02-23 12:30:16 -07:00
public function boot(): void
{
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(); ?>");
}
}