/**
  * 添加菜单--入库
  * 
  * @param        
  * 
  * @author        wen.zhou@bioon.com
  * 
  * @date        2015-10-18 12:19:40
  * 
  * @return        
  */
 public function postAdd()
 {
     $returnData = ['status' => false, 'msg' => '数据丢失'];
     /*添加角色*/
     $role = new Role();
     $role->name = request('name', '');
     $role->description = request('description', '');
     $role->slug = request('slug', '');
     $role->level = request('level', 1);
     $add_bool = $role->save();
     if ($add_bool) {
         /*添加权限*/
         $permissions = request('permissions', '');
         if (!empty($permissions)) {
             $role->detachAllPermissions();
             $selected_permissions = Permission::whereIn('slug', $permissions)->get();
             foreach ($selected_permissions as $selected_permission) {
                 $role->attachPermission($selected_permission);
             }
         }
         $returnData = ['status' => true, 'msg' => '修改成功'];
     } else {
         $returnData = ['status' => true, 'msg' => '修改成功'];
     }
     return response()->json($returnData);
 }