且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Laravel文件夹结构

更新时间:2022-06-13 01:10:38

掌握Laravel文件夹结构的***方法是将 app 目录视为 框架的前端.如果您查看 git仓库,您会发现它们是分开的-您可以克隆核心库,然后可以单独克隆laravel应用程序.应用程序及其子文件夹仅表示使用框架的一种方法.当然,它是根据***实践来设计的.还请检查核心框架 tests 目录-Laravel开发人员将库视为无头"-无需应用程序.对我来说,这是我掌握Laravel所需的一切.

Best way to master Laravel folder structure is to treat app directory as a front end of framework. If you take a look at the git repository you'll see that they are separated - you can clone core library and you can clone laravel application alone. Application, with it's subfolders represents just one way in which framework can be used. Ofcourse, it is designed with best practices involved. Check out also core framework tests directory - there Laravel developers treated library as "headless" - without application. For me, it was everything I need to grasp Laravel.

因此,您可以***地修改现有结构,但是请记住,某些更改要求您 composer dump-autoload -主要是由于名称空间.

So you are free to modify existing structure, but keep in mind that some changes require you to composer dump-autoload - mostly because of namespaces.