ParseError
syntax error, unexpected '|', expecting variable (T_VARIABLE) (View: D:\phpts\data\wwwroot\blog\resources\views\welcome.blade.php)
Laravel 使用livewire后出现的问题,使用两个开发环境都碰到同样的问题:
出错的代码:
D:\phpts\data\wwwroot\blog\vendor\mediconesystems\livewire-datatables\src\Column.php:118
出错代码具体内容(红色的两行):
public static function callback(
array|string $columns,
Closure|string $callback,
array $params = [],
?string $callbackName = null
) {
$column = new static;
$column->name = 'callback_' . ($callbackName ?? crc32(json_encode(func_get_args())));
$column->callback = $callback;
$column->additionalSelects = is_array($columns) ? $columns : array_map('trim', explode(',', $columns));
$column->params = $params;
return $column;
}
环境1. phpts PHP Version 7.4.6
环境2. Laragon PHP Version 8.1.9
环境2. Laragon PHP Version 7.4.19
来源地址:https://blog.csdn.net/qq_23295825/article/details/126583732