/**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     //Auth::logout();
     $action = DB::transaction(function () use($id) {
         try {
             $permission = Permission::findOrFail($id);
             Permission::destroy($id);
             if (request()->ajax()) {
                 $data = ['status' => 'succes', 'statusText' => 'Ok', 'responseText' => 'Permissie \'' . $permission->name . '\' is verwijderd'];
                 return response()->json($data, 200);
             }
             Flash::success('De gebruiker ' . $id . '');
         } catch (\Exception $e) {
             if (request()->ajax()) {
                 $data = ['status' => 'succes', 'statusText' => 'Fail', 'responseText' => '' . $e->getMessage() . ''];
                 return response()->json($data, 400);
             }
             Flash::error('Delete is mislukt!<br>' . $e->getMessage() . ' ' . $id . '');
         }
     });
     if (request()->ajax()) {
         return $action;
     }
     return redirect()->back();
 }