dorisdong0514 2017-07-19 05:49
浏览 1004
已采纳

如何在IntelliJ IDEA中配置Laravel项目结构?

Which folders I'm supposed to mark as Sources/Resources/Excluded?

enter image description here

  • 写回答

1条回答 默认 最新

  • dongshiliao7990 2017-07-19 08:48
    关注

    My own logic based on the PHPStorm guide

    Sources

    The root folder
    

    reasoning: Your source code can be in mutliple folder inside the root.

    alternative: Just mark the real folder you have your code inside app, bootstrap, config, routes, (more...)

    Click this button to mark the selected folder as the root for namespaces used in your project. Based on this setting, PhpStorm suggests you the proper folder name when you want to create a new namespace under another parent namespace during creation or moving a PHP class, that is, when you are actually creating or moving a PHP class to a non-existing namespace under another parent namespace. If no Sources folder is specified, you will have to type the proper folder manually.

    Appointing a Sources folder is not mandatory but this helps you keep your project structure in compliance with the PSR0 and PSR4 standards. See Configuring PHP Namespaces in a Project for details.

    Tests

    tests
    

    reasoning: For obvious reasons your tests live there by default. It might be possible you use some test library for your javascript code that lives in another folder.

    Click this button to mark the selected folder as a test root.

    Excluded

    vendor, storage
    

    reasoning: All (composer) libraries we use in our project live in vendor, but are not our own code. We should not search trough it by default. In storage live caching files, files that have no significant meaning to us, we do not track them in version control (like vendor). We could just delete them and the application would still work.

    Click this button to mark the selected folder as excluded so PhpStorm ignores it during indexing, parsing, and code completion.

    Resource Root

    public
    

    reasoning: Your own frontend assets should be (somewhere) under the public folder to serve to the browser. Frontend assets are (mostly?) files, javascript and css.

    Click this button to enable PhpStorm to complete relative paths to resources under the selected folder.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 iOS 自定义输入法-第三方输入法
  • ¥15 很想要一个很好的答案或提示
  • ¥15 扫描项目中发现AndroidOS.Agent、Android/SmsThief.LI!tr
  • ¥15 怀疑手机被监控,请问怎么解决和防止
  • ¥15 Qt下使用tcp获取数据的详细操作
  • ¥15 idea右下角设置编码是灰色的
  • ¥15 全志H618ROM新增分区
  • ¥15 在grasshopper里DrawViewportWires更改预览后,禁用电池仍然显示
  • ¥15 NAO机器人的录音程序保存问题
  • ¥15 C#读写EXCEL文件,不同编译