課程引入 spatie/Laravel-partialcache 包報錯

白小二發表於2020-03-11

InvalidArgumentException : The directive name [] is not valid. Directive names must only contain alphanumeric characters and unde
rscores.

at /var/www/test2/vendor/laravel/framework/src/Illuminate/View/Compilers/BladeCompiler.php:511
507| */
508| public function directive($name, callable $handler)
509| {
510| if (! preg_match(‘/^\w+(?:::\w+)?$/x’, $name)) {

511| throw new InvalidArgumentException(“The directive name [{$name}] is not valid. Directive names must only contain
alphanumeric characters and underscores.”);
512| }
513|
514| $this->customDirectives[$name] = $handler;
515| }

Exception trace:

1 Illuminate\View\Compilers\BladeCompiler::directive(Object(Closure))
/var/www/test2/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php:239

2 Illuminate\Support\Facades\Facade::__callStatic(“directive”)
/var/www/test2/vendor/spatie/laravel-partialcache/src/PartialCacheServiceProvider.php:28

Please use the argument -v to see more details.
新手一個不知道咋解決

本作品採用《CC 協議》,轉載必須註明作者和本文連結

相關文章