/** * Return an array with character information. * This includes the key info as well as the * extended information such as type/expiry etc. * * @return array */ public function all_with_info() { $response = []; foreach (EveApiKeyModel::all() as $key) { $response[$key->key_id] = ['enabled' => $key->enabled, 'user_id' => $key->user_id, 'key_id' => $key->key_id, 'v_code' => str_limit($key->v_code, 15), 'access_mask' => $key->info ? $key->info->accessMask : null, 'type' => $key->info ? $key->info->type : null, 'expires' => $key->info ? $key->info->expires : null, 'last_error' => $key->last_error, 'characters' => count($key->characters) > 0 ? implode(', ', $key->characters->lists('characterName')->all()) : null]; } return $response; }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { $keys = ApiKey::all(); return response()->json($keys); }