Move Laravel 5 Eloquent models into its own directory

后端 未结 5 1303
你的背包
你的背包 2021-01-30 08:44

Laravel 5 has ORM models by default in app folder. I want to move these into app/models. When I do that then these classes are not found anymore.

How to make Laravel fin

5条回答
  •  耶瑟儿~
    2021-01-30 09:33

    Just create a folder named Models and move your files into it. After that, change the namespace of the models from just App to App\Models (update the usages as well) and run composer dump-autoload.

提交回复
热议问题