Laravelアプリケーションを公開するため、XAMPPをインストールしてデプロイ後サーバー起動して
設定したURLにアクセスしたら。以下のようなエラーが出て解決できない状態になってます。
Parse error: syntax error, unexpected '=' in C:\Users\hoge\~\xampp\htdocs\project\vendor\laravel\framework\src\Illuminate\Support\Arr.php on line 384
上記のようなメッセージのみ出ている状況です。
Arr.phpの中身が原因のようですが、このファイルは元々laravelプロジェクト作成時に生成されたファイルなので今まで触ってきませんでした。なのにエラーの対象になってるのでどこが間違っているかわからない状態です。
もし解決方法がわかる人がいらっしゃったら教えていただきたいです。
以下PHPのバージョンとArr.phpの384付近になります。
・PHPバージョン(php -v)
PHP 7.1.30 (cli) (built: May 28 2019 15:12:11) ( ZTS MSVC14 (Visual C++ 2015) x86 ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies C:\Users\Owner\devenv\Laravel\1_project\laravelapp>
・Arr.phpの384付近のコード
public static function pluck($array, $value, $key = null) { $results = []; [$value, $key] = static::explodePluckParameters($value, $key); ★この行が384行目 foreach ($array as $item) { $itemValue = data_get($item, $value); // If the key is "null", we will just append the value to the array and keep // looping. Otherwise we will key the array using the value of the key we // received from the developer. Then we'll return the final array form. if (is_null($key)) { $results[] = $itemValue; } else { $itemKey = data_get($item, $key); if (is_object($itemKey) && method_exists($itemKey, '__toString')) { $itemKey = (string) $itemKey; } $results[$itemKey] = $itemValue; } } return $results; }
よろしくお願いいたします。
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。