首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >UpdateButton错误数组到字符串的转换,Laravel

UpdateButton错误数组到字符串的转换,Laravel
EN

Stack Overflow用户
提问于 2018-01-11 19:47:25
回答 1查看 639关注 0票数 2

当我在我的editoffice.blade.php中点击更新按钮时,会显示

“数组到字符串的转换(视图: C:\xampp\htdocs\Eguide\resources\views\editoffice.blade.php)”

editoffice.blade.php

代码语言:javascript
运行
复制
{!! Form::open(array('route' => ['editoffice', ['id' => $id, 'office_id' => $office->id]], 'class' => 'form')) !!}

这就是错误所指向的地方。如何解决这个问题?

错误屏幕截图

在更新函数中使用dd($request->all());时的结果

路线

代码语言:javascript
运行
复制
  Route::get('/', 'BuildingController@index')->name('index');

Route::get('building/{id}', 'PageController@show')->name('building');

Route::get('office/{id}', 'OfficeController@show')->name('officeMenu');

Route::get('offices', 'OfficeController@index');

Route::group(['middleware' => ['auth']], function () {

  Route::get('buildings/create', 'BuildingController@create')->name('createbform');

  Route::post('building/create/store', 'BuildingController@saveBuilding')->name('createbuilding');

  Route::get('building/{id}/edit', 'BuildingController@edit');

  Route::post('building/{id}/edit', 'BuildingController@update')->name('editbuilding');

  Route::get('building/{id}/delete', 'BuildingController@destroy');

  Route::get('building/{id}/offices/create', 'OfficeController@create')->name('createofficeform');

  Route::post('building/{id}/offices/create/store', 'OfficeController@store')->name('createoffice');

Route::get('building/{id}/offices/{office_id}/edit', 'OfficeController@edit')->name('editofficeform');

Route::post('building/{id}/offices/{office_id}/edit', 'OfficeController@update')->name('editoffice');


  Route::get('offices/{id}/delete', 'OfficeController@destroy')->name('deleteoffice');
});
EN

Stack Overflow用户

回答已采纳

发布于 2018-01-11 19:58:36

请尝试此操作,因为我认为您的表单语法错误

代码语言:javascript
运行
复制
{!! Form::open(array('route' => ['login', 'id' => $id, 'office_id' => $office->id], 'class' => 'form')) !!}

并创建与您的使用相关的路由

票数 1
EN
查看全部 1 条回答
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/48206311

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档