1818use Longman \LaravelLodash \Validation \StrictTypeValidator ;
1919use Longman \LaravelLodash \Validation \Validator ;
2020
21- use function app ;
2221use function array_keys ;
23- use function array_pad ;
2422use function config ;
2523use function config_path ;
26- use function preg_split ;
2724use function resource_path ;
2825use function str_replace ;
29- use function trim ;
3026
3127class ServiceProvider extends LaravelServiceProvider
3228{
@@ -75,8 +71,6 @@ function (Translator $translator, array $data, array $rules, array $messages): V
7571 },
7672 );
7773
78- $ this ->registerBladeDirectives ();
79-
8074 $ this ->loadTranslations ();
8175 //$this->loadValidations();
8276 }
@@ -103,28 +97,6 @@ protected function registerCommands(): void
10397 $ this ->commands (array_keys ($ this ->commands ));
10498 }
10599
106- protected function registerBladeDirectives (): void
107- {
108- if (! config ('lodash.register.blade_directives ' )) {
109- return ;
110- }
111-
112- // Display relative time
113- app ('blade.compiler ' )->directive ('datetime ' , static function ($ expression ) {
114- return "<?php echo '<time datetime=\'' . with( $ expression)->toIso8601String()
115- . '\' title=\'' . $ expression . '\'>'
116- . with( $ expression)->diffForHumans() . '</time>' ?> " ;
117- });
118-
119- // Pluralization helper
120- app ('blade.compiler ' )->directive ('plural ' , static function ($ expression ) {
121- $ expression = trim ($ expression , '() ' );
122- [$ count , $ str , $ spacer ] = array_pad (preg_split ('/,\s*/ ' , $ expression ), 3 , "' ' " );
123-
124- return "<?php echo $ count . $ spacer . str_plural( $ str, $ count) ?> " ;
125- });
126- }
127-
128100 protected function registerRequestMacros (): void
129101 {
130102 if (! config ('lodash.register.request_macros ' )) {
0 commit comments