运行“phpartisanmigrate”什么都不做:没有数据库修改,没有消息(也没有“nothingtomigrate”),没有错误。也没有记录被添加到表迁移中。以前,“phpartisanmigrate”命令运行良好。文件夹database/migrations中的一个迁移文件具有以下内容:integer('test');});}/***Reversethemigrations.**@returnvoid*/publicfunctiondown(){Schema::table('vids',function(Blueprint$table){//});}}如何使“phpartisa
我在我的Laravel应用程序中从Controller运行Artisan命令。Asthedocsspecify,你可以这样排队:Artisan::queue('email:send',['user'=>1,'--queue'=>'default']);这会处理队列逻辑,在我的例子中,会将作业发送到Redis,它几乎会立即得到处理。我想推迟工作。你cannormallydothis像这样调用队列命令时:$job=(newSendReminderEmail($user))->delay(60);$this->dispatch($job);有没有办法加入这些函数,这样我就可以将我的Artis
所以我有一个名为iCron的界面namespaceApp\Console\CronScripts;interfaceiCron{publicstaticfunctionrun($args);}我还有一个使用这个叫做UpdateStuff的类classUpdateStuffimplementsiCron{publicstaticfunctionrun($args=NULL){//Idoapicallsheretoupdatemyrecordsecho"BeginUpdatingStuff";}}所以在内核中我有:useApp\Console\CronScripts\UpdateStuff
与许多主机一样,我们的公共(public)文件夹称为public_html。这是在共享主机上,因此无法更改。我已将public文件夹更改为public_html以反射(reflect)这一点,但是当我这样做时artisanserve停止工作。每次我尝试启动它时,我都会得到:[ErrorException]chdir():Nosuchfileordirectory(errno2)如果我将文件夹重命名回public然后artisanserve再次开始工作。我试过了followingthispostonlaracasts,帖子中的用户报告artisan为他们工作,但这对我没有影响。如何更改文
我经常使用xdebug来调试应用程序,我构建了一个laravel应用程序,它上传一个csv,将数据插入数据库,并将ID插入作业队列。我编写了一个artisan命令,通过cron运行,然后对这些数据执行某些操作。Xdebug可通过浏览器访问站点,但在从cli运行时不会在断点处中断。我运行php5-fpm。我的文件/etc/php5/fpm/php.ini和/etc/php5/cli/php/ini两者都包含以下设置:zend_extension=/usr/lib/php5/20121212/xdebug.soxdebug.remote_enable=1xdebug.idekey='dev
这个问题在这里已经有了答案:Laravelmigration:uniquekeyistoolong,evenifspecified(40个答案)关闭5年前。我有以下错误。有人明白这是为什么吗?phpartisanmigrateSQLSTATE[42000]:Syntaxerrororaccessviolation:1071Specifiedkeywastoolong;maxkeylengthis767bytes(SQL:altertable`users`addunique`users_email_unique`(`email`))创建用户表.phpSchema::create('use
我开发了一些自定义artisan命令,以便更轻松地与我的包一起使用。是否可以将artisan命令包含到包中以便于部署?如果可以,怎么做?谢谢。 最佳答案 在你的包结构中设置命令:您可以在您的包裹服务提供商中:registerMyCommand();$this->commands('mycommand');}privatefunctionregisterMyCommand(){$this->app['mycommand']=$this->app->share(function($app){returnnewMyCommand;});}
我使用Laravel5.2并通过运行创建数据库表phpartisanmake:migrationcreate_categories_table--create=categories和phpartisanmake:migrationcreate_posts_table--create=posts然后我运行phpartisanmigrate,并在数据库中创建表。但是在我对迁移文件“create_posts_table.php”进行了一些更改并运行之后phpartisanmigrate:rollback我遇到了一个错误:[Symfony\Component\Debug\Exception\F
我使用的是Laravel最新版本:3.2.1。当我在终端上运行时:phpartisan迁移:安装我有这个错误:找不到驱动程序我在Google和Laravel的论坛上进行了一些搜索,但一无所获。编辑我已经激活了扩展,这就是我在phpinfo()上的内容--with-iconv''--with-pdo-mysql=mysqlnd''--with-pdo-pgsql=/opt/lampp/postgresql''--with-pdo看起来像我的pdo已设置。这是我的phpinfo()的图像编辑2我做了一个小测试:query('SELECT*frompdo_test')as$row){prin
我关注了这个tutorial关于将WordPress与Laravel结合使用,我能够从我的LaravelController访问WordPress功能。基本示例20,'order'=>'ASC','orderby'=>'post_title',]);return$posts;}这行得通,而且我已经能够访问到目前为止我尝试过的所有WordPress方法。问题当我创建并注册一个新的artisan命令并尝试从那里访问那些相同的方法时,我遇到了困难。20,'offset'=>10,'hide_empty'=>true,]);return$tags;}据我所知,Laravel5通过index.p