내 디렉토리 구조는 여기 등 청구, 예외, 저장소를 포함 응용 프로그램 디렉토리에서 사용자 지정 폴더를 사용하고로드되지 클래스 ...Laravel PSR-4 자동
app
-iw
-Billing
-BillingInterface.php
-StripeBilling.php
-Exceptions
-Repositories
-macros.php
composer.json
"psr-4": {
"iw\\" : "app/iw"
},
명령 composer dump-autoload -o
클래스 실행
// app/iw/BillingInterface.php (location)
<?php namespace iw\Billing;
interface BillingInterface {}
그리고
// app/iw/StripeBilling.php (location)
<?php namespace iw\Billing;
class StripeBilling {
public function bill()
{
dd('billing');
}
}
난 내가 vendor/composer/autoload_ps4.php
이 새 폴더에 업데이트되지 않은 것으로 나타났습니다 클래스를 찾을 수 없습니다 오류가 발생하고있다. 도와주세요. 감사
잘 구조가 모두 올바른, 작곡가 0 오류를 제공 보면? 호기심에서'' "psr-4"''선언은 자동로드 트리에 있습니까? 작곡가 자체 업데이트를 시도 했습니까? – arma
@arma 예 composer는 0의 에러를 제공합니다. 그리고 나는 작곡가 자기 업데이트 – seoppc
을 시험해 보았는데 그것은 똑같은 테스트를 만들었고 예상대로 작동했습니다. – arma