/**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     $model = LicenseType::findOrFail($id);
     $model->delete();
     Session::flash('flash_message', 'License type has been successfully deleted!');
     return redirect()->back();
 }
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function edit($id)
 {
     $license_type_arr = array();
     $license_types = VehicleType::find($id)->license_types->toArray();
     if (!empty($license_types)) {
         foreach ($license_types as $license_type) {
             $license_type_arr[] = $license_type['id'];
         }
     }
     $type = VehicleType::find($id);
     $options = array();
     $license_types = LicenseType::all();
     if (!empty($license_types)) {
         foreach ($license_types as $license_type) {
             $options[$license_type->id] = $license_type->type;
         }
     }
     return view('vehicle_types.update', compact('type', 'options', 'license_type_arr'));
 }