저는 laravel에 상당히 익숙하며 응용 프로그램에서 psr-4 자동 로딩에 문제가 있습니다.ReflectionException 클래스가 존재하지 않습니다 psr-4
내 폴더 구조 :
-app
-config
-controllers
-UsersController
-Mynamespace
-User.php
내 composer.json 파일 :
"autoload": {
"classmap": [
"app/commands",
"app/controllers",
"app/database/migrations",
"app/database/seeds",
"app/tests/TestCase.php"
],
"psr-4": {
"Mynamespace\\": "app/Mynamespace"
}
그럼 내가 달릴 :
composer dump-autoload
내 사용자 모델 :
<?php namespace Mynamespace;
use Illuminate\Auth\UserTrait;
use Illuminate\Auth\UserInterface;
use Illuminate\Auth\Reminders\RemindableTrait;
use Illuminate\Auth\Reminders\RemindableInterface;
use Eloquent;
class User extends Eloquent implements UserInterface, RemindableInterface {
...
내 공급 업체/작곡가/자동로드-psr4.php : 나는 오류가 존재하지 않는 ReflectionException 클래스 사용자를 받고
'model' => 'Mynamespace\User',
계속 :
...
return array(
'Monolog\\' => array($vendorDir . '/monolog/monolog/src/Monolog'),
'Mynamespace\\' => array($baseDir . '/app/Mynamespace'),
);
는 내 설정/auth.php 변경. 도와주세요!
['app/config/auth.php'] (https://github.com/laravel/laravel/blob/master/app/config/auth.php#L31)에서'model'을' Mynamespace \ User'? – Marwelln
Yes to \t 'model'=> 'Mynamespace/User', – WaffleBoy
사용자 모델은'User.php'라는 파일에 저장되어 있습니다. 맞습니까? 당신이 당신의 UsersController로 언급했기 때문에 나는 묻습니다. – wolfemm