我在数据库中有此数据(表allow_upgrade_qualifi):
该数据在视图中随Foreach一起加载:
<div class="col-md-4">
<div class="checkbox-list">
@foreach($permit_permit_upgrade_qualifi as $ppuq)
<label class="checkbox-inline" for="ppuq-label-{{$ppuq->id}}">
<input type="checkbox" name="ppuq[]" id="ppuq-label-{{$ppuq->id}}" value="{{$ppuq->id}}" {{ $permit_upgrade_qualifi->permit_id = $permit->id ? 'checked' : '' }}>{{$ppuq->title}}
</label>
@endforeach
</div>
</div>
和我在Controller中的代码:
public function edit($id)
{
$idd = Sentry::getUser()->id;
try {
$permit = UpgradePermit::findOrFail($id);
$base = Base::all();
$permit_permit_upgrade_qualifi = PermitUpgradeQualifi::all();
$permit_upgrade_qualifi = DB::table('permit_permit_upgrade_qualifi')->where('permit_id', $id)->get();
// return $permit_upgrade_qualifi;
$cites = DB::table('provinces')->get();
$profile = User::find($idd);
return View::make('manager.user_up_permit.edit', compact('permit','base','permit_permit_upgrade_qualifi','permit_upgrade_qualifi', 'cites', 'profile'));
} catch (ModelNotFoundException $e) {
return Redirect::route('dashboard.user.up-permit.index')->with('danger', 'درخواست معتبر نمیباشد.');
}
}
并将此数据存储在数据库中的复选框(表permit_permit_upgrade_qualifi):
现在,如何在视图中显示选中的复选框?
谢谢