data sudah dapat dimasukkan dari database dan tampil di sistem, namun ketika diedit dari sistem terdapat error,,

<?PHP

class SettingController extends BaseController
{
public function index()
{
//
$setting = setting::all();
$users = users::all();
$value = Session::get('login');
//print_r($value);
//exit;
if (!Session::has('login'))
{
return Redirect::to('login');
}
//print_r($setting);
//exit;
// load the view and pass the nerds
$id = 0;
foreach(Session::get('login') as $key )
{
$id =$key->id;
//echo $key->email_user;
}
$datas = DB::SELECT("select * from settings where id_user='".$id."'");

$settings = DB::SELECT("select * from settings where id_user='".$id."' order by nama_table asc");


return View::make('setting.index')
->with('users', $users)
->with('setting', $datas)
->with('settings', $settings);
}

/**
* Show the form for creating a new resource.
*
* return Response
*/

public function create()
{
//
$users = users::all();


$value = Session::get('login');
//print_r($value);
//exit;
if (!Session::has('login'))
{
return Redirect::to('login');
}
return View::make('setting/index')
->with('users', $users);
}

/**
* Store a newly created resource in storage.
*
* return Response
*/
public function store()
{
//
$rules = array(
'nama_table' => 'required',
'create' => 'required',
'update' => 'required',
'delete' => 'required',
'view' => 'required'
//'id_topic' => 'required'
);
$validator = Validator::make(Input::all(), $rules);

// process the login
if ($validator->fails()) {
return Redirect::to('setting/index')
->withErrors($validator)
->withInput(Input::except('password'));
} else {
// store
$settings = new settings;
$settings->nama_table = Input::get('nama_table');
$settings->create = Input::get('create');
if (is_array('create')) {
for ($i = 0; $i < count($create); $i++) {
$settings = DB::table('settings')->insertGetId(array('create'=>Input::get('create'),'settings',$create[$i]));

}
}
$settings->update = Input::get('update');
if (is_array('update')){
for ($i = 0; $i < count($update); $i++) {
$settings = DB::table('settings')->insertGetId(array('edit'=>Input::get('update'),'settings',$update[$i]));

}
}
$settings->delete = Input::get('delete');
if (is_array('delete')) {
for ($i = 0; $i < count($delete); $i++) {
$settings = DB::table('settings')->insertGetId(array('delete'=>Input::get('delete'),'settings',$delete[$i]));

}
}
$settings->view = Input::get('view');
if (is_array('view')) {
for ($i = 0; $i < count($view); $i++) {
$settings = DB::table('settings')->insertGetId(array('view'=>Input::get('view'),'settings',$view[$i]));

}
}
//$setting->id_user = Input::get('id_user');
//$setting->id_topic = Input::get('id_topic');

$settings->save();
// redirect
Session::flash('message', 'Successfully created setting!');
return Redirect::to('setting');
}

}

/**
* Display the specified resource.
*
* param int $id
* return Response
*/
public function show($id)
{
//
$setting = setting::find($id);

// show the view and pass the nerd to it
return View::make('setting.show')
->with('setting', $setting);
}

/**
* Show the form for editing the specified resource.
*
* param int $id
* return Response
*/
public function edit($id)
{
//
$setting = setting::find($id);

$users = users::all();

$value = Session::get('login');
//print_r($value);
//exit;
if (!Session::has('login'))
{
return Redirect::to('login');
}
$settings = DB::SELECT("select * from settings where id_user='".$id."' order by nama_table asc");

return View::make('setting.edit')
->with('users', $users)
->with('setting', $setting)
->with('settings', $settings);

}

/**
* Update the specified resource in storage.
*
* param int $id_setting
* return Response
*/
public function update($id)
{
//
$rules = array(
'nama_table' => 'required',
'create' => 'required',
'update' => 'required',
'delete' => 'required',
'view' => 'required'
);
$validator = Validator::make(Input::all(), $rules);

// process the login
if ($validator->fails()) {
return Redirect::to('setting/' . $id . '/edit')
->withErrors($validator)
->withInput(Input::except('password'));
} else {
// store
$setting = setting::find($id);
$setting = new settings;
$setting->nama_table = Input::get('nama_table');
$setting->create = Input::get('create');
if (is_array('create')) {
for ($i = 0; $i < count($create); $i++) {
$setting = DB::table('settings')->insertGetId(array('create'=>Input::get('create'),'settings',$create[$i]));

}
}
$setting->update = Input::get('update');
if (is_array('update')){
for ($i = 0; $i < count($update); $i++) {
$setting = DB::table('settings')->insertGetId(array('edit'=>Input::get('update'),'settings',$update[$i]));

}
}
$setting->delete = Input::get('delete');
if (is_array('delete')) {
for ($i = 0; $i < count($delete); $i++) {
$setting = DB::table('settings')->insertGetId(array('delete'=>Input::get('delete'),'settings',$delete[$i]));

}
}
$setting->view = Input::get('view');
if (is_array('view')) {
for ($i = 0; $i < count($view); $i++) {
$setting = DB::table('settings')->insertGetId(array('view'=>Input::get('view'),'settings',$view[$i]));

}
}
//$setting->id_user = Input::get('id_user');
//$setting->id_topic = Input::get('id_topic');

$setting->save();
// redirect
Session::flash('message', 'Successfully updated setting!');
return Redirect::to('setting');
}
}

/**
* Remove the specified resource from storage.
*
* param int $id
* return Response
*/
public function destroy($id)
{
//
$setting = setting::find($id);
$setting->delete();

// redirect
Session::flash('message', 'Successfully deleted the setting!');
return Redirect::to('setting');
}

}

index.blade.php

<!DOCTYPE html>


<html lang="en" class="no-js">
<!--<![endif]-->
<!-- BEGIN HEAD -->
<head>
<meta charset="utf-8"/>
<title> </title>
<!-- BEGIN GLOBAL MANDATORY STYLES -->

@include('headerjs')
</head>
<!-- END HEAD -->
<!-- BEGIN BODY -->
<body class="page-header-fixed">
@include('header')
<div class="clearfix">
</div>
<!-- BEGIN CONTAINER -->
<div class="page-container">
<!-- BEGIN SIDEBAR -->
<div class="page-sidebar-wrapper">
<div class="page-sidebar navbar-collapse collapse">
<!-- add "navbar-no-scroll" class to disable the scrolling of the sidebar menu -->
@include('menu')
</div>
</div>
<!-- END SIDEBAR -->
<!-- BEGIN CONTENT -->
<div class="page-content-wrapper">
<div class="page-content">


<div class="row">
<div class="col-md-12">
<!-- BEGIN PAGE TITLE & BREADCRUMB-->
<h3 class="page-title">
User Management
</h3>
<ul class="page-breadcrumb breadcrumb">
<li>
<i class="fa fa-home"></i>
<a href="index.html">
User
</a>
<i class="fa fa-angle-right"></i>
</li>
<li>
<a href="#">
User Management
</a>
</li>
<li class="pull-right">
<div id="dashboard-report-range" class="dashboard-date-range tooltips" data-placement="top" data-original-title="Change dashboard date range">
<i class="fa fa-calendar"></i>
<span>
</span>
<i class="fa fa-angle-down"></i>
</div>
</li>
</ul>
<!-- END PAGE TITLE & BREADCRUMB-->
</div>
</div>
<!-- END PAGE HEADER-->

<div class="clearfix">
</div>
<div class="row">

<!-- BEGIN PORTLET-->


<!-- will be used to show any messages -->
@if (Session::has('message'))
<div class="alert alert-info">{{ Session::get('message') }}</div>
@endif
{{ HTML::ul($errors->all()) }}
{{ Form::open(array('url' => 'setting')) }}

<div class="col-md-3">
<label for="id_user">User</label>
<select id="id_user" name="id_user" class="form-control">
@foreach($users as $key => $value)
<option value="{{ $value->id }}">{{ $value->nama_user }}</option>
@endforeach
</select>
</div>
<br /><br /><br /> <br /><br /><br />
<table class="table table-striped table-bordered">
<thead>
<tr>
<td>No</td>
<td>Nama Tabel</td>
<td>Create</td>
<td>Update</td>
<td>Delete</td>
<td>View</td>
</tr>
</thead>

<thead>
<?php $no = 1; ?>
@foreach($settings as $key => $value)
<tr>
<td>{{$no}}</td>
<td>{{$value->nama_table}}</td>
<td>
<input name="create" type="checkbox" value="" id=""
@if($value->create==1)
checked="checked"
@endif

>

</td>
<td>
<input name="update" type="checkbox" value="" id=""
@if($value->update==1)
checked="checked"
@endif
>

</td>
<td>
<input name="delete" type="checkbox" value="" id=""
@if($value->delete==1)
checked="checked"
@endif
>

</td>
<td>
<input name="view" type="checkbox" value="" id=""
@if($value->view==1)
checked="checked"
@endif
>

</td>
</tr>
<?php $no++; ?>
@endforeach
</table>
{{ Form::submit('Save', array('class' => 'btn btn-primary')) }}



<!-- END START TASK LIST -->


</div>
</div>
</div>
<!-- END CONTAINER -->
@include('footer')
Silahkan login untuk menjawab!