草庐IT

laravel-censor

全部标签

php - Laravel 5.3 socialite 安装报错

我正在尝试使用此命令安装laravelsocialite插件composerrequirelaravel/socialite但是我会得到如下错误YourrequirementscouldnotberesolvedtoaninstallablesetofpackagesProblem1-laravel/socialitev3.0.0requiresilluminate/http~5.4->satisfiablebyilluminate/http[v5.4.0].-laravel/socialitev3.0.2requiresilluminate/http~5.4->satisfiable

php - 为什么 laravel 5.4 没有 see() 方法

laravel5.4是否移除了see()方法?它在phpunit测试中用于View。它之前可以在laravel5.2中使用,但现在命令提示符显示。calltoundefinedmethod 最佳答案 Laravel5.4使用LaravelDusk执行浏览器测试。您正在寻找的新方法是assertSee(). 关于php-为什么laravel5.4没有see()方法,我们在StackOverflow上找到一个类似的问题: https://stackoverflow

php - Laravel 方法通知不存在

如果一个新的表单被插入到数据库中,我试图通知用户,但是我得到这个错误:BadMethodCallExceptioninMacroable.phpline74:Methodnotifydoesnotexist.这是通知类Prescriptions=$Prescription;}/***Getthenotification'sdeliverychannels.**@parammixed$notifiable*@returnarray*/publicfunctionvia($notifiable){return['database'];}/***Getthemailrepresentatio

php - Laravel 将变量放入@lang()

@lang('bonus.foo')@lang('bonus.{{$data["ruleclass"]}}')我需要在laravel中将变量放入@lang中,变量可以是有条件的,有人知道如何实现吗? 最佳答案 使用传统的php连接方式,@lang('bonus.'.$data["ruleclass"]) 关于php-Laravel将变量放入@lang(),我们在StackOverflow上找到一个类似的问题: https://stackoverflow.com

php - 如何在 Laravel 5.2 上安装 Socialite 2.0

我正在尝试通过composer在laravel5.2上安装socialite2.0,但它给了我一个错误:Therequestedpackagelaravel/socialite^3.0existsaslaravel/socialite[v2.0.0]butthesearerejectedbyyourconstraint.-laravel/socialitev3.0.2requiresilluminate/http~5.4->satisfiablebyilluminate/http[v5.4.0,v5.4.13,v5.4.9].-laravel/socialitev3.0.3requir

php - 在一对多关系 laravel 5 中保存多条记录

我试图在一对多关系中保存多条记录。我有以下两个模型。ProductModelclassProductextendsModel{protected$primaryKey='product_id';public$timestamps=FALSE;publicfunctionSize(){return$this->hasMany('App\Size');}}SizeModelclassSizeextendsModel{public$timestamps=FALSE;protected$fillable=['product_id','size'];publicfunctionProduct()

php - Laravel: Blade View 中的 undefined variable

这是AdminController.php:$images]);}}这是admin.blade.php:@extends('template')@section('title')AdminPage@endsection@section('header')@endsection@section('main')@if(Auth::check())@foreach($imagesas$image)id}}'>{{$image->content}}id}}/delete"method="post">Deletecaptionid}}/approve"method="post">Acceptim

php - 如何在资源/ View 目录 Laravel 中创建文件

我正在使用Laravel5.0,如果它没有像这样退出,我正在尝试创建一个Viewif(view()->exists($moduleName.$getCategoryNameToLowerCase)){//ifexistreturntheviewreturnview($moduleName.$getCategoryNameToLowerCase);}else{//elsecreateaviewandreturnit;fopen(app_path('../resources/','views/'.$moduleName.'.'.$getCategoryNameToLowerCase.'.b

php - 将数据从 Controller 传递到 Blade View laravel

我正在尝试通过href将参数发送到从事件列表到事件页面的页面。我的路线是Route::get('eventpage','EventController@index')->name('eventpage');我的事件Controller是query('id');$event=DB::table('events')->where('id',$id)->get();$pics=DB::table('pictures')->where('event_id',$id)->get();$n=count($pics);//thenumberofpicturesforaparticulareventr

php - 如何在 PHP/Laravel 中访问没有 foreach 的值?

在我的PHP代码中,我注意到我只能使用foreach访问我的值。谁能解释为什么?returnview('pages.temp_page_course',['page'=>$this->course($slug),]);publicfunctioncourse($slug){$course=Course::where('slug',$slug)->get();return$course;}使用这段代码,我可以访问该值。@foreach($pageas$key=>$course){{$course->title}}@endforeach如何在不执行foreach的情况下访问值?非常感谢