[英]Laravel 5.4 array_merge(): Argument #2 is not an array error while using components forms
當我使用大表格而不是html表格時,它給了我這個錯誤
settings.blade.php;
@if (is_array($settings) || is_object($settings))
@foreach($settings as $set)
{{ Form::bstext('title', $set->title )}}
.
.
.
@endforeach
@endif
FormServiceProvider.php
Form::component('bstext', 'components.form.text', ['name', 'value', 'attributes']);
和text.blade.php
<div class="col-md-4">
<div class="form-group">
<label>{{$name}}</label>
{{ Form::text($name, $value, array_merge(['class' => 'form-control'], $attributes)) }}
</div>
</div>
我在哪里弄錯了?
我編輯了我的formserviceprovider,它起作用了。
Form::component('input_form', 'components.form.input', ['name', 'value', 'attributes'=>[]]);
感謝@u_mulder
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.