$terminal['id'], 'name' => $terminal['name'], 'work_code' => $terminal['work_code'], 'work_group' => $terminal['work_group'], 'soft' => $terminal['soft'], 'is_active' => $is_active, 'key' => $terminal['key'], 'last_activity' => $terminal['last_activity'], ); } return [ 'status' => 'success', 'terminals' => $out, ]; } } if (isset($input['code'])) { $setting = Settings::where('code', $input['code']) ->first(); if ($setting) { return [ 'status' => 'success', 'code' => $setting['code'], 'value' => $setting['value'], ]; } else { return [ 'status' => 'error', 'more' => 'Setting not found', ]; } } else { $settings = Settings::all(); return [ 'status' => 'success', 'settings' => $settings, ]; } } }