netbeans 中的新 Laravel 项目
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/33767605/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
New laravel project in netbeans
提问by divHelper11
My friends helped me to install composer, laravel I have also downloaded some laravel projects through SVN. I just wanted to start my own another laravel project. After hours spent on reading about it I honestly do not understand how to create a new laravel project in netbeans. After clicking new project there is option of chosing framework like zend or symphony but my laravel is not there. Could someone advide me please?
朋友帮我安装了composer,laravel 我也通过SVN下载了一些laravel项目。我只是想开始我自己的另一个 Laravel 项目。在花了几个小时阅读它之后,老实说,我不明白如何在 netbeans 中创建一个新的 Laravel 项目。单击新项目后,可以选择像 zend 或 Symphony 这样的框架,但我的 laravel 不在那里。有人可以给我建议吗?
EDIT: I can see a lot of views on this topic so I will just say that it is only necessary to install composer, do everything according to laravels manual and only open the project through netbeans, not create it there directly.
编辑:我可以看到很多关于这个主题的观点,所以我只想说只需要安装composer,按照laravel手册做所有事情,只通过netbeans打开项目,而不是直接在那里创建。
采纳答案by Bogdan
If you read the Installationsection from the Laravel Docs you'll see that you only need to run a couple of commands to create a new Laravel app. Open a terminal (command prompt if you're on Windows) and type the following commands:
如果您阅读Laravel 文档中的安装部分,您会发现您只需要运行几个命令即可创建一个新的 Laravel 应用程序。打开终端(如果您使用的是 Windows,则为命令提示符)并键入以下命令:
1.Get the Laravel installer:
1.获取 Laravel 安装程序:
composer global require "laravel/installer=~1.1"
2.Go to the directory you want to install Laravel in:
2.进入你想要安装 Laravel 的目录:
cd path/to/directory
3.Then make sure you have added the composer vendor directory to the PATH system variable (instructions) by appending the following (of course, replace [username]
in that path with your actual Windows username):
3.然后通过附加以下内容(当然,在该路径中替换为您的实际 Windows 用户名),确保您已将 composer vendor 目录添加到 PATH 系统变量(指令[username]
):
;C:\Users\[username]\AppData\Roaming\Composer\vendor\bin\
;C:\Users\[用户名]\AppData\Roaming\Composer\vendor\bin\
4.Create a new Laravel:
4.创建一个新的 Laravel:
laravel new myapp
The last command will create the app in path/to/directory/myapp
. Then all you need to do is create a new project and selecting the source folder you just created your Laravel application in:
最后一个命令将在path/to/directory/myapp
. 然后你需要做的就是创建一个新项目并选择你刚刚创建你的 Laravel 应用程序的源文件夹:
回答by svarog
The above solution gave me a lot of errors and eventually I gave up, I've found a much cleaner way to setup a minimal Laravel application by using a seed project.
上面的解决方案给了我很多错误,最终我放弃了,我找到了一种更简洁的方法来使用种子项目设置最小的 Laravel 应用程序。
Tested in Netbeans 8.2 (I think it should work on all 8 versions).
在 Netbeans 8.2 中测试(我认为它应该适用于所有 8 个版本)。
- Install Composeron your system
- Installer the Composer plugin for Netbeans (It's in the plugins menu, under the PHP category).
- New Project > PHP Application
- Go though the wizard, and setup your project. the last step should be named
Composer
- In the last step, search (under
Token:
) forlaravel
- Select
laravel/laravel: The Laravel Framework.
and move it to the selected frameworks on the right Click
Finish
, and you're Done!
- 在您的系统上安装Composer
- 为 Netbeans 安装 Composer 插件(它在插件菜单中,在 PHP 类别下)。
- 新建项目 > PHP 应用程序
- 通过向导,并设置您的项目。最后一步应该命名
Composer
- 在最后一步中,搜索(在 下
Token:
)laravel
- 选择
laravel/laravel: The Laravel Framework.
并移动到右侧的选定框架 单击
Finish
,您就完成了!