在接下来的教程中,为了保证我们的代码风格一致,以避免引起不必要的歧义。我们在 Atom 上安装一个叫 EditorConfig 的插件,在进行团队协作开发时,这个插件能起到很大作用。安装完成之后,我们需要在 Laravel 应用的根目录下添加 .editorconfig
文件,并写入如下的配置信息。
editorconfig
# coding styles between different editors and IDEs
# editorconfig.org
root = true
[*]
# Change these settings to your own preference
indent_style = space
indent_size = 4
# We recommend you to keep these unchanged
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = false
[*.{js,html,blade.php,css,scss}]
indent_style = space
indent_size = 4
[*.md]
trim_trailing_whitespace = false
接着让我们将该文件加入到版本控制中。