2018-01-13 23:06:19 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Pterodactyl\Providers;
|
|
|
|
|
|
|
|
use Illuminate\Support\ServiceProvider;
|
|
|
|
|
|
|
|
class BladeServiceProvider extends ServiceProvider
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Perform post-registration booting of services.
|
|
|
|
*/
|
2023-02-23 20:30:16 +01:00
|
|
|
public function boot(): void
|
2018-01-13 23:06:19 +01:00
|
|
|
{
|
|
|
|
$this->app->make('blade.compiler')
|
|
|
|
->directive('datetimeHuman', function ($expression) {
|
2021-01-23 21:09:16 +01:00
|
|
|
return "<?php echo \Carbon\CarbonImmutable::createFromFormat(\Carbon\CarbonImmutable::DEFAULT_TO_STRING_FORMAT, $expression)->setTimezone(config('app.timezone'))->toDateTimeString(); ?>";
|
2018-01-13 23:06:19 +01:00
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|