/**
  * @param $request
  *
  * @return array
  */
 private function parseData($request)
 {
     $role = $request->user()->role_id;
     $route = explode('.', $request->route()->getName());
     $official = ['menu', 'users', 'actions'];
     if (in_array($route[0], $official)) {
         return [$role, (object) ['roles' => config('quickadmin.defaultRole') . ',']];
     } else {
         $menuName = $route[1];
     }
     $menu = Menu::where('name', ucfirst($menuName))->firstOrFail();
     return [$role, $menu];
 }
 public function edit($id)
 {
     $menu = Menu::findOrFail($id);
     $parentsSelect = Menu::where('menu_type', 2)->lists('title', 'id')->prepend('-- no parent --', 'null');
     $roles = Role::all();
     return view('qa::menus.edit', compact('menu', 'parentsSelect', 'roles'));
 }