composer.json
my model files are stored in directory of app\models,
therefor
"autoload": {
"classmap": [
"database",
"app/Models"
],
"psr-4": {
"App\\": "app/",
"Models\\": "app/Models/"
}
},
then
composer dump-autoload
bingo! O(∩_∩)O~
如果!! 我说如果!!! 还是不行的!!!
千万别忘了,自建的Model要加namespace,同样每个使用到Model的Controller中要user namespace ....