草庐IT

laravel-queue

全部标签

php - 如何 array_values laravel 集合?

我有一个来自image模型的搜索结果,$photo保存了$photo->type=='photo'的数据。$photo=$image->filter(function($photo,$key)use($path){if($photo->type=='photo'){$photo->url=$path.$photo->image;return$photo;}});这是$photo集合,有什么方法可以array_values()items数据吗?Collection{#352▼#items:array:3[▼2=>ImageBanquet{#349▶}3=>ImageBanquet{#35

php - Laravel 5.2 在寄存器中添加条款和条件

我想在我的注册验证表中添加条款和条件,但它不起作用。谁能帮我解决这个问题。查看has('terms')?'has-error':''}}">Agreewiththetermsandconditions@if($errors->has('terms')){{$errors->first('terms')}}@endif授权Controllerprotectedfunctionvalidator(array$data){returnValidator::make($data,['name'=>'required|max:255','company'=>'required|max:255',

php - 在布局中的 Laravel 5.3 View 中包含 PHP 变量

基于Laravel通知电子邮件模板,这是我正在尝试做的事情。我尝试为电子邮件设计一个带有变量的布局,以便在我的布局中定义一些样式,但可以在我的电子邮件View中访问。这是一个例子:emails/layout.blade.php[...]@php$style=['body'=>'font-size:12px;color:#000;','paragraph'=>'font-size:10px;color:#eee;'];@endphp@yield('content')在我的电子邮件View中:@extends('emails.layout')@section('content')Hithe

php - 如何在 Laravel 中分类 - 子分类

关闭。这个问题需要更多focused.它目前不接受答案。想改进这个问题吗?更新问题,使其只关注一个问题editingthispost.关闭5年前。Improvethisquestion你好,我有一个新项目。我想在这个项目中建立一个多分类系统。例子类别-子类别-子类-Subsubsubcategory-Subsubsubsubcategory-子子类别。等等..我使用的是laravel5.4版本。怎么做这个?

php - 使用 throttle 中间件在 laravel 中增加 X-RateLimit-Limit

我可以找到降低该值的方法,但在我的情况下,我正在运行许多异步API调用,需要将X-RateLimit-Limit增加到100以上才能正常工作。请提出替代方案。以下是我得到的回复P.S-我也在使用auth中间件eHTTP/1.1429TooManyRequests日期:2017年3月10日星期五11:18:24GMT服务器:Apache/2.4.17(Win32)OpenSSL/1.0.2dPHP/5.5.35X-Powered-By:PHP/5.5.35缓存控制:无缓存X-RateLimit-限制:60X-RateLimit-剩余:0重试后:24Set-Cookie:XSRF-TOKE

php - 如何在自定义类 laravel 5 中使用 session ?

这是我的代码:我是laravel5的新手,我刚刚添加了一个新的自定义函数。在那个函数里面我想检查一个session('id)?但是我有这样的错误FatalErrorExceptioninmyFunctions.phpline8:Class'App\CustomLibrary\Session'notfound我需要知道如何正确使用session。 最佳答案 将此子句添加到类的顶部,紧跟在namespace部分之后:useSession;或者使用完整的命名空间:if(\Session::get('id')!=null)或者使用sessi

php - 在新的 Laravel 5.4 上使用“npm run dev”命令时出错

我已经为此苦苦挣扎了5个小时。这是我尝试在新安装的Laravel上运行“npmrundev”时遇到的错误>@dev/var/www/html/capsule>cross-envNODE_ENV=developmentnode_modules/webpack/bin/webpack.js--progress--hide-modules--config=node_modules/laravel-mix/setup/webpack.config.jsevents.js:160thrower;//Unhandled'error'event^Error:spawnnode_modules/web

php - (Laravel) 解析错误 : syntax error, 意外 '<'

我在说Parseerror:syntaxerror,unexpected'时遇到了一些错误这是我在Laravel中的观点@for($i=0;$i{{date("Y",strtotime($data[$i]->date))}}{{date("M",strtotime($data[$i]->date))}}{{$data[$i]->total}}{{$st[$i]}}{{$bt[$i]}}@if({{$ftm[$i]}}==null)@elseif({{$ftm[$i]}}!=null){{$ftm[$i]}}@endif{{$pe[$i]}}@endfor有什么解决办法吗?

php - Cpdf.php 行 3855 : Undefined index: at barryvdh/laravel-dompdf 中的 ErrorException

我使用的是laravel5.2,dompdf在本地主机上运行良好,但是当移动到AWS时,它一直显示ErrorExceptioninCpdf.phpline3855:Undefinedindex:,在这一行(3855)中有字体变量。示例代码:$html="Hello";PDF::setOptions(['dpi'=>150,'defaultFont'=>'sans-serif']);$pdf=PDF::loadHTML($html)->setPaper('a4','landscape');return$pdf->download('pdfview.pdf');由于barryvdh/lar

php - laravel 5 - 我如何添加 ->index() 到现有的外键

框架:Laravel5.2数据库:MySQLPHP:7.0我有“pops”表:Schema::create('pops',function(Blueprint$table){$table->string('id')->primary()->index();$table->string('ab_test_parent_id')->nullable();$table->string('cloned_parent_id')->nullable();$table->timestamps();});还有“转化”表:Schema::create('conversions',function(Blu