不支持的操作数类型laravel 5.2

时间:2017-10-07 09:58:15

标签: laravel-5.2

insert.blade.php

       {!! Form::select('country', ['' => 'Select'] +$countries,'',array('class'=>'form-control','id'=>'country','style'=>'width:350px;'));!!}      



  'Form' => Collective\Html\FormFacade::class,
         'Html' => Collective\Html\HtmlFacade::class,


        When i m adding above     'Form' => Collective\Html\FormFacade::class,
         'Html' => Collective\Html\HtmlFacade::class, in app.php it give me the following error 
    Unsupported operand types laravel 5.2
        and 
    When i removed  'Form' => Collective\Html\FormFacade::class,
         'Html' => Collective\Html\HtmlFacade::class,
    i m getting class 'Form' not found

代码中的问题是什么?         在哪里编辑代码? 代码中的问题是什么?         在哪里编辑代码? 代码中的问题是什么?         在哪里编辑代码?

1 个答案:

答案 0 :(得分:1)

问题是

['' => 'Select'] +$countries和您的$国家/地区不是数组形式(Eloquent return object)

尝试在视图中添加toArray()或在Controller中添加toArray()

['' => 'Select'] +$countries->toArray()