phpvms/app/Providers/DirectiveServiceProvider.php
Nabeel S b36a3009dd
Cleanup Utils #467 (#547)
* Remove Utils Facade
2020-02-11 12:32:41 -05:00

24 lines
601 B
PHP

<?php
namespace App\Providers;
use Illuminate\Support\Facades\Blade;
use Illuminate\Support\ServiceProvider;
/**
* Keep custom directives that can be used in templates
*/
class DirectiveServiceProvider extends ServiceProvider
{
public function boot(): void
{
Blade::directive('minutestotime', function ($expr) {
return "<?php echo \App\Support\Units\Time::minutesToTimeString($expr); ?>";
});
Blade::directive('minutestohours', function ($expr) {
return "<?php echo \App\Support\Units\Time::minutesToHours($expr); ?>";
});
}
}