開発環境
Laravel 5.8.26
困っている事
私は現在バックエンドにLaravelを使ってAPI認証を行おうとしています。しかし、POSTのリクエストをLaravelに送信すると500エラーが表示され、Logには下記のエラーが出力されていました。このエラーはどのように改善すればいいのでしょうか。
log
1local.ERROR: Class hash does not exist {"exception":"[object] (ReflectionException(code: -1): Class hash does not exist at /var/www/html/Laravel/vendor/laravel/framework/src/Illuminate/Container/Container.php:790)
試した事
キャッシュをクリアして見ましたが、効果はありませんでした。
追記
エラーが出ているコードはこちらになります。
/var/www/html/Laravel/vendor/laravel/framework/src/Illuminate/Container/Container.php
php
1public function build($concrete) 2 { 3 // If the concrete type is actually a Closure, we will just execute it and 4 // hand back the results of the functions, which allows functions to be 5 // used as resolvers for more fine-tuned resolution of these objects. 6 if ($concrete instanceof Closure) { 7 return $concrete($this, $this->getLastParameterOverride()); 8 } 9 10 $reflector = new ReflectionClass($concrete); // ここがエラーが出ている790行目 11 12 // If the type is not instantiable, the developer is attempting to resolve 13 // an abstract type such as an Interface or Abstract Class and there is 14 // no binding registered for the abstractions so we need to bail out. 15 if (! $reflector->isInstantiable()) { 16 return $this->notInstantiable($concrete); 17 } 18 19 $this->buildStack[] = $concrete; 20 21 $constructor = $reflector->getConstructor(); 22 23 // If there are no constructors, that means there are no dependencies then 24 // we can just resolve the instances of the objects right away, without 25 // resolving any other types or dependencies out of these containers. 26 if (is_null($constructor)) { 27 array_pop($this->buildStack); 28 29 return new $concrete; 30 } 31 32 $dependencies = $constructor->getParameters(); 33 34 // Once we have all the constructor's parameters we can create each of the 35 // dependency instances and then use the reflection instances to make a 36 // new instance of this class, injecting the created dependencies in. 37 $instances = $this->resolveDependencies( 38 $dependencies 39 ); 40 41 array_pop($this->buildStack); 42 43 return $reflector->newInstanceArgs($instances); 44 }
回答1件
あなたの回答
tips
プレビュー