草庐IT

lumen-5.4

全部标签

php - 如何从 Laravel 5.2 升级到 5.4?

我想将Laravel更新到最新版本5.4。但是laravelmigrationguide中没有给出直接迁移,所以首先我尝试将它迁移到laravel5.3。我的项目正在开发5.2laravel版本并尝试升级它。我已经按照laravel迁移指南文档的指导更新了composer.json。并在命令行上运行命令composerupdate。我收到以下错误。LoadingcomposerrepositorieswithpackageinformationUpdatingdependencies(includingrequire-dev)Yourrequirementscouldnotbereso

php - 带有 Laravel 5.4 的 Instagram API

我正在使用Instagram包vinkla将用户数据获取到我的应用程序。这是我用来获取结果的代码:publicfunctioninstagram(){$insta=newInstagram();$getUser=$insta->get('gopro');dd($getUser);}当我放弃结果时,我在返回时得到这个数组:array:20[▼0=>{#205▼+"id":"1552323772757218591_28902942"+"code":"BWK9j8rlpUf"+"user":{#208▶}+"images":{#202▼+"thumbnail":{#203▶}+"low_re

php - Laravel 5.4 是否已完成记录作业的解决方案?

我在我的项目中使用Laravel5.4和MySQL。远程服务器是PHPServer7当用户将记录保存到数据库时,它还会创建一个队列作业以通知相关公司官员。我的代码在Controller文件中foreach($audit->mailusersAS$mailuser){$this->dispatch(newSendAuditEmail($audit->id,$mailuser->name,$mailuser->email));}我正在为QUEUEDRIVER使用数据库。我的意思是它是这样写在.env文件中的:QUEUE_DRIVER=database如您所知,如果您使用“数据库”而不是“r

php - 拉维尔 5.4 : get products with favorite and display favorites product for each user

我正在尝试获取收藏夹中的所有产品并像用户登录一样显示它们,收藏夹中的该产品将显示为收藏夹,否则他可以将它们添加到收藏夹。这是我的Controller$products=(newProduct)->where('quantity','>',0)->with('favorite')->orderBy('price',$sort)->get();现在如果我制作dd($product->favorite)我会像这样得到最喜欢的数组[{"id":1,"product_id":7,"user_id":1,"created_at":"2018-04-0109:16:23","updated_at":

php - PHP 5.4 的 Dreamweaver CS5 代码提示和语法错误

我做了一些研究,但没有找到完全适合我的情况的东西。我正在将DreamweaverCS5与PHP文件一起使用,Dreamweaver提醒我我的代码中存在以下行的错误:if(explode("_","some_variable")[0]=="some"){如果我删除方括号[]那么错误消息就会消失,使行成为if(explode("_","some_variable")=="some"){//nevertrueobviously我知道我可以将展开的数组分配给一个变量,然后调用该变量的第一个值来删除这段代码,但我试图找到一个能够编写更多速记代码的解决方案。我从这里的答案中发现PHP5.4版支持这

php - 在运行时为 Lumen 的 .env 文件中定义的 APP_LOCALE 设置值

我最近开始学习Lumen微框架,我需要在运行时更改我的.env文件中定义的APP_LOCALE键的值。我的目标是在运行时切换语言以打印我的语言文件中定义的特定字符串的不同翻译。在Lumen文档中是这样写的:Tosetconfigurationvaluesatruntime,passanarraytotheconfighelper所以我在测试Controller中尝试了休闲:useIlluminate\Support\Facades\App;useLaravel\Lumen\Routing\ControllerasBaseController;classControllerextends

php - Lumen 从文件中读取 JSON

我正在使用LumenFramework我正在尝试从json为我的数据库播种文件。我正在做这样的事情:publicfunctionrun(){$json=json_decode(file_get_contents('database/seed/file.json'),true);...}但是当我执行种子命令时phpartisandb:seed,我得到这个错误:[ErrorException]file_get_contents(database/seed/file.json):failedtoopenstream:Nosuchfileordirectory我试着这样做:https://st

php - 在 Laravel 5.4 中从迁移中删除列

我使用像这样的迁移创建了一个表:Schema::create('listings',function(Blueprint$table){$table->increments('id');$table->decimal('original_price',10,2);$table->decimal('discouted_price',10,2);$table->integer('city_id')->index()->unsigned()->nullable();$table->foreign('city_id')->references('id')->on('cities');$tabl

php - laravel 5.4 php artisan serve 无效请求(意外的 EOF)

我正在使用Windows10和wamp服务器,我刚刚安装了laravel,我得到的只是这条错误消息,每次我打开laravel时是否有必要执行phpartisanserve?只要我关闭cmd提示localhost:8000refusedtoconnect。Phpartisan服务错误 最佳答案 我认为您正在通过phpartisanserve命令运行Laravel项目blog并且您正在通过localhost:8000或127.0.0.1:8000浏览您的应用程序您的屏幕截图显示,当您尝试访问未在routes/web.php中定义的url

php - 在 Laravel 5.4 中找不到类 'NumberFormatter'

我正在尝试使用PHP的国际扩展将金额转换为单词。例如,1450->OneThousandFourHundredandFifty我使用的是在XAMPP3.2.2服务器上运行的Laravel5.4和PHP5.6.24。正如在类似问题中提到的,我已经通过在PHP.ini文件中取消对extension=ext/php_intl.dll行的注释来启用intlPHP扩展,并且之后重新启动了我的服务器。$inWords=new\NumberFormatter('en',\NumberFormatter::SPELLOUT);echo$inWords->format(1450);产生错误:FatalE