get(); // Cache::put('authorities', $authorities, config('cache.expirations.authorities')); // } // return $authorities; // } // // /** // * @param Authority $authority // * @return Role[] // * @throws Exception // */ // function getRoles(Authority $authority){ // if(!$authority['id']??'') throw new Exception('User对象或id不能为空'); // $roles = Cache::get('authorityGetRoles'.$authority['id']); // if(!$roles){ // $roles = Authority::with('roles')->get(); // Cache::put('authorities', $roles, config('cache.expirations.authorities')); // } // return $roles; // } }