我正在使用这个教程:http://www.findalltogether.com/tutorial/simple-blog-application-in-laravel-5-part-1-setup-database/来使用Laravel创建博客。
在教程中,它说要进行迁移,我必须运行php artisan make:migration posts
。我在哪里运行这个?我尝试了bash
,但收到错误:Could not open input file: artisan
。
我在Windows上,使用XAMPP -这可能是一个原因吗?
3条答案
按热度按时间6kkfgxo01#
你必须进入
artisan
所在的文件夹(通常是项目的根目录),并使用CMD或CONSOLE写入php artisan make:migration posts
g9icjywg2#
首先从命令提示符导航到你的项目目录,如果你已经在你的项目中安装了laravel,那么应该有可用的artisan,你可以通过输入“dir”找到artisan,一旦你找到artisan,你应该运行相应的命令。此外,一旦你到达你的项目目录进行测试,你可以写这一行“php artisan“(不带引号)并按Enter键,您将看到artisan中可用的所有命令列表。
谢谢
ftf50wuq3#
您可以在项目文件夹中运行
php artisan make:migration posts
。举例来说:
假设你的Laravel项目在
C:\\documents\projects\my-project
中,你需要在终端中打开文件夹my-project
。使用Visual Studio代码
如果你有Visual Studio Code,你可以在VSC中打开项目文件夹,并通过点击
Ctrl
+Shift
+ Back Tick Key(). Then, run
php artisan make:migration posts`在IDE中使用终端。使用命令终端
打开命令终端,转到项目目录,运行命令:
cd path/to/folder
。然后,在项目文件夹中运行
php artisan make:migration posts
。