리포지토리에 리플렉션 예외가 발생했습니다. 나는 단순히 해결책을 찾지 못한다. 왜 예외가 던져지고있는 것일까? 4 배의 철자 검사를 받았고 4 배의 검사는 사례를, 4 배의 검사는 네임 스페이스를 검사했습니다. 내가 오류는 다음Laravel Repository에 ReflectionException 클래스가 없습니다.
ReflectionException in Container.php line 731: Class App\Repositories\ProductRepository does not exist
ProductController.php은 다음과 같습니다 컨트롤러를 :
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Repositories\ProductRepository;
class ProductsController extends Controller
{
protected $product;
public function __construct(ProductRepository $product){
$this->product = $product;
}
//Other Methods...
}
ProductRepository.php가있는 저장소 :
App\Repositories
다음과 같이 표시됩니다.
<?php
namespace App\Repositories;
class ProductRepository {
public function getProducts(){
//Some Query
}
}
모든 Laravel 포럼과 스택을 해답을 찾았지만 해결책이 없습니다. 나는 몇 시간 동안 해결책을 찾으려고 노력해 왔으며, 수업이 어떻게 인식되지 않는지 짐작할 수 없었습니다. 내가 여기서 누락 될 수있는 아이디어가 있습니까?
감사를 사용하여 일부 캐시를 제거해야합니다. 지난 1 시간 동안'composer dump-autoload','php artisan cache : clear' 및'php artisan clear-compiled '를 약 100 회 실행했습니다. 아무것도 작동하지 않습니다. –
@BillDukelow 파일 이름에 공백이 생길 수 있습니까? 예를 들어 파일의 처음이나 끝에? 오타를 찾고 파일을 다시 작성하십시오 –
예. 방금 확인했는데 공백이 없습니다. 방금 Repositories 디렉토리를 삭제하고 디렉토리와 파일을 다시 만들었습니다. 여전히 같은 오류. –