Laravel 5.4更新数据库后不返回页面

时间:2017-07-17 12:31:02

标签: laravel laravel-5.4

当我更新数据库时,我的返回页面没有打开..它在交易页面上干扰..

settings.blade.php;

<form action="{{url('/admin/save-settings')}}" method="post">

{{csrf_field()}}

@if (is_array($settings) || is_object($settings))

@foreach($settings as $setting)

.
.
.

@endforeach
@endif

</form>

路线; (在管理员前缀下)

Route::post('/save-settings','AdminController@postSavesettings');
});

和控制器;

public function postSavesettings(Request $mainsetdata)
{
    unset($mainsetdata['_token']);
    $settings=Settings::where('id',1)->update($mainsetdata->all());

    return view('back.settings')->with('settings',$settings);

}

我哪里弄错了?

2 个答案:

答案 0 :(得分:0)

首先查看错误日志以查找编码部分中的问题。如果没有发现错误

试试这样:

return view('back.settings',compact('settings'))->with('success','setting update successfully');

答案 1 :(得分:0)

当更改下面的回报时,它有效,

return redirect()->back();